From 87932e3f3611302753db574b68620a002f2183af Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 29 Jul 2026 23:44:40 +0000 Subject: [PATCH 01/11] Configurations: 'specification/deviceupdate/data-plane/duiothub/tspconfig.yaml', API Version: 2026-06-01, SDK Release Type: stable, and CommitSHA: '67ffbb6bee462e36bcdd3b93cffca6942c3a35f7' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6636753 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-iot-deviceupdate/CHANGELOG.md | 15 +- .../azure-iot-deviceupdate/_metadata.json | 6 +- .../azure-iot-deviceupdate/api.md | 182 ++++++-- .../azure-iot-deviceupdate/api.metadata.yml | 6 +- .../apiview-properties.json | 202 ++++----- .../azure/iot/deviceupdate/_client.py | 9 +- .../azure/iot/deviceupdate/_configuration.py | 6 +- .../azure/iot/deviceupdate/_patch.py | 42 +- .../iot/deviceupdate/_utils/model_base.py | 54 ++- .../iot/deviceupdate/_utils/serialization.py | 109 +++++ .../azure/iot/deviceupdate/aio/_client.py | 9 +- .../iot/deviceupdate/aio/_configuration.py | 6 +- .../azure/iot/deviceupdate/aio/_patch.py | 42 +- .../aio/operations/_operations.py | 309 ++++++++------ .../iot/deviceupdate/aio/operations/_patch.py | 88 +--- .../deviceupdate/operations/_operations.py | 403 ++++++++++-------- .../iot/deviceupdate/operations/_patch.py | 86 +--- .../azure/iot/deviceupdate/types.py | 269 ++++++++++++ .../azure-iot-deviceupdate/pyproject.toml | 41 +- .../azure-iot-deviceupdate/tsp-location.yaml | 2 +- 20 files changed, 1092 insertions(+), 794 deletions(-) create mode 100644 sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md index 2c82bfd62b64..992f0a2c7e8c 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md @@ -1,19 +1,8 @@ # Release History -## 1.1.0 (2026-06-15) +## 1.1.0 (2026-07-29) -### Features Added - -- Regenerated client from TypeSpec specification. The library now uses the unified - `azure.core` HTTP pipeline and shares model infrastructure with other modern - Azure Python SDKs. - -### Other Changes - -- Migrated source of truth from Swagger to TypeSpec - (`specification/deviceupdate/data-plane/duiothub`). -- Updated minimum required `azure-core` to `1.37.0`. -- Dropped support for Python 3.8 and 3.9; minimum supported Python is 3.10. +skip changelog generation for data-plane package and please add changelog manually. ## 1.0.0 (2022-09-09) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json index 614a01ddd585..f1a5c7e5f91a 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json +++ b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json @@ -3,9 +3,9 @@ "apiVersions": { "DeviceUpdateClient": "2026-06-01" }, - "commit": "292231b1131ff9fd070377372a0647c6ac7a6ce2", + "commit": "67ffbb6bee462e36bcdd3b93cffca6942c3a35f7", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/deviceupdate/data-plane/duiothub", - "emitterVersion": "0.63.1", - "httpClientPythonVersion": "^0.31.1" + "emitterVersion": "0.63.3", + "httpClientPythonVersion": "^0.34.2" } \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.md b/sdk/deviceupdate/azure-iot-deviceupdate/api.md index 061ec5136ea0..3df29b42d692 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.md @@ -1,15 +1,18 @@ ```py namespace azure.iot.deviceupdate - class azure.iot.deviceupdate.DeviceUpdateClient(DeviceUpdateClientGenerated): implements ContextManager + class azure.iot.deviceupdate.DeviceUpdateClient: implements ContextManager + device_management: DeviceManagementOperations + device_update: DeviceUpdateOperations def __init__( self, endpoint: str, - instance_id: str, credential: TokenCredential, + instance_id: str, *, - api_version: Optional[str] = ..., + api_version: str = ..., + polling_interval: Optional[int] = ..., **kwargs: Any ) -> None: ... @@ -26,15 +29,18 @@ namespace azure.iot.deviceupdate namespace azure.iot.deviceupdate.aio - class azure.iot.deviceupdate.aio.DeviceUpdateClient(DeviceUpdateClientGenerated): implements AsyncContextManager + class azure.iot.deviceupdate.aio.DeviceUpdateClient: implements AsyncContextManager + device_management: DeviceManagementOperations + device_update: DeviceUpdateOperations def __init__( self, endpoint: str, - instance_id: str, credential: AsyncTokenCredential, + instance_id: str, *, - api_version: Optional[str] = ..., + api_version: str = ..., + polling_interval: Optional[int] = ..., **kwargs: Any ) -> None: ... @@ -51,7 +57,7 @@ namespace azure.iot.deviceupdate.aio namespace azure.iot.deviceupdate.aio.operations - class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): + class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations: def __init__( self, @@ -82,7 +88,7 @@ namespace azure.iot.deviceupdate.aio.operations self, group_id: str, deployment_id: str, - deployment: JSON, + deployment: Deployment, *, content_type: str = "application/json", **kwargs: Any @@ -239,15 +245,15 @@ namespace azure.iot.deviceupdate.aio.operations **kwargs: Any ) -> LogCollectionOperationDetailedStatus: ... + @distributed_trace_async async def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> DeviceOperation: ... @distributed_trace_async async def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... @@ -379,7 +385,7 @@ namespace azure.iot.deviceupdate.aio.operations async def start_log_collection( self, log_collection_id: str, - log_collection: JSON, + log_collection: LogCollection, *, content_type: str = "application/json", **kwargs: Any @@ -418,7 +424,7 @@ namespace azure.iot.deviceupdate.aio.operations async def update_device_class( self, device_class_id: str, - device_class_patch: JSON, + device_class_patch: PatchBody, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -435,7 +441,7 @@ namespace azure.iot.deviceupdate.aio.operations ) -> DeviceClass: ... - class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): + class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations: def __init__( self, @@ -464,7 +470,7 @@ namespace azure.iot.deviceupdate.aio.operations @overload async def begin_import_update( self, - update_to_import: list[JSON], + update_to_import: list[ImportUpdateInputItem], *, content_type: str = "application/json", **kwargs: Any @@ -479,6 +485,7 @@ namespace azure.iot.deviceupdate.aio.operations **kwargs: Any ) -> AsyncLROPoller[None]: ... + @distributed_trace_async async def get_file( self, provider: str, @@ -487,21 +494,21 @@ namespace azure.iot.deviceupdate.aio.operations file_id: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> UpdateFile: ... + @distributed_trace_async async def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> UpdateOperation: ... + @distributed_trace_async async def get_update( self, provider: str, @@ -509,10 +516,9 @@ namespace azure.iot.deviceupdate.aio.operations version: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> Update: ... @distributed_trace def list_files( @@ -1470,7 +1476,7 @@ namespace azure.iot.deviceupdate.models namespace azure.iot.deviceupdate.operations - class azure.iot.deviceupdate.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): + class azure.iot.deviceupdate.operations.DeviceManagementOperations: def __init__( self, @@ -1501,7 +1507,7 @@ namespace azure.iot.deviceupdate.operations self, group_id: str, deployment_id: str, - deployment: JSON, + deployment: Deployment, *, content_type: str = "application/json", **kwargs: Any @@ -1658,15 +1664,15 @@ namespace azure.iot.deviceupdate.operations **kwargs: Any ) -> LogCollectionOperationDetailedStatus: ... + @distributed_trace def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> DeviceOperation: ... @distributed_trace def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... @@ -1798,7 +1804,7 @@ namespace azure.iot.deviceupdate.operations def start_log_collection( self, log_collection_id: str, - log_collection: JSON, + log_collection: LogCollection, *, content_type: str = "application/json", **kwargs: Any @@ -1837,7 +1843,7 @@ namespace azure.iot.deviceupdate.operations def update_device_class( self, device_class_id: str, - device_class_patch: JSON, + device_class_patch: PatchBody, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -1854,7 +1860,7 @@ namespace azure.iot.deviceupdate.operations ) -> DeviceClass: ... - class azure.iot.deviceupdate.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): + class azure.iot.deviceupdate.operations.DeviceUpdateOperations: def __init__( self, @@ -1883,7 +1889,7 @@ namespace azure.iot.deviceupdate.operations @overload def begin_import_update( self, - update_to_import: list[JSON], + update_to_import: list[ImportUpdateInputItem], *, content_type: str = "application/json", **kwargs: Any @@ -1898,6 +1904,7 @@ namespace azure.iot.deviceupdate.operations **kwargs: Any ) -> LROPoller[None]: ... + @distributed_trace def get_file( self, provider: str, @@ -1906,21 +1913,21 @@ namespace azure.iot.deviceupdate.operations file_id: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> UpdateFile: ... + @distributed_trace def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> UpdateOperation: ... + @distributed_trace def get_update( self, provider: str, @@ -1928,10 +1935,9 @@ namespace azure.iot.deviceupdate.operations version: str, *, etag: Optional[str] = ..., - if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ): ... + ) -> Update: ... @distributed_trace def list_files( @@ -1981,4 +1987,112 @@ namespace azure.iot.deviceupdate.operations ) -> ItemPaged[str]: ... +namespace azure.iot.deviceupdate.types + + class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicy(TypedDict, total=False): + key "failure": Required[CloudInitiatedRollbackPolicyFailure] + key "update": Required[UpdateInfo] + failure: CloudInitiatedRollbackPolicyFailure + update_property: UpdateInfo + + + class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): + key "devicesFailedCount": Required[int] + key "devicesFailedPercentage": Required[int] + devices_failed_count: int + devices_failed_percentage: int + + + class azure.iot.deviceupdate.types.Deployment(TypedDict, total=False): + key "deploymentId": Required[str] + key "downloadSecurity": Union[str, DownloadSecurity] + key "groupId": Required[str] + key "isCanceled": bool + key "isCloudInitiatedRollback": bool + key "isRetried": bool + key "rollbackPolicy": ForwardRef('CloudInitiatedRollbackPolicy', module='types') + key "startDateTime": Required[str] + key "update": Required[UpdateInfo] + deployment_id: str + deviceClassSubgroups: list[str] + device_class_subgroups: list[str] + download_security: Union[str, DownloadSecurity] + group_id: str + is_canceled: bool + is_cloud_initiated_rollback: bool + is_retried: bool + rollback_policy: CloudInitiatedRollbackPolicy + start_date_time: str + update_property: UpdateInfo + + + class azure.iot.deviceupdate.types.DeviceUpdateAgentId(TypedDict, total=False): + key "deviceId": Required[str] + key "moduleId": str + device_id: str + module_id: str + + + class azure.iot.deviceupdate.types.FileImportMetadata(TypedDict, total=False): + key "filename": Required[str] + key "url": Required[str] + filename: str + url: str + + + class azure.iot.deviceupdate.types.ImportManifestMetadata(TypedDict, total=False): + key "hashes": Required[dict[str, str]] + key "sizeInBytes": Required[int] + key "url": Required[str] + hashes: dict[str, str] + size_in_bytes: int + url: str + + + class azure.iot.deviceupdate.types.ImportUpdateInputItem(TypedDict, total=False): + key "friendlyName": str + key "importManifest": Required[ImportManifestMetadata] + files: list[FileImportMetadata] + friendly_name: str + import_manifest: ImportManifestMetadata + + + class azure.iot.deviceupdate.types.LogCollection(TypedDict, total=False): + key "createdDateTime": str + key "description": str + key "deviceList": Required[list[DeviceUpdateAgentId]] + key "lastActionDateTime": str + key "operationId": str + key "status": Union[str, OperationStatus] + created_date_time: str + description: str + device_list: list[DeviceUpdateAgentId] + last_action_date_time: str + log_collection_id: str + status: Union[str, OperationStatus] + + + class azure.iot.deviceupdate.types.PatchBody(TypedDict, total=False): + key "friendlyName": Required[str] + friendly_name: str + + + class azure.iot.deviceupdate.types.UpdateId(TypedDict, total=False): + key "name": Required[str] + key "provider": Required[str] + key "version": Required[str] + name: str + provider: str + version: str + + + class azure.iot.deviceupdate.types.UpdateInfo(TypedDict, total=False): + key "description": str + key "friendlyName": str + key "updateId": Required[UpdateId] + description: str + friendly_name: str + update_id: UpdateId + + ``` \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml index 408933ae1cdd..a4a121bbf943 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 555c6332bae64960b1565938ed0453aac0b22874c60b4c3c7ed0d8de8156c371 -parserVersion: 0.3.28 -pythonVersion: 3.13.12 +apiMdSha256: e6da310dba4ea5263163ad432f276371b3025fcca87680847e130581a6157980 +parserVersion: 0.3.30 +pythonVersion: 3.13.14 diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json index 5d72b7c26227..d5edd1a08519 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json +++ b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json @@ -51,106 +51,106 @@ "azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState": "DeviceUpdateClient.DeviceClassSubgroupDeploymentState", "azure.iot.deviceupdate.models.DeviceHealthState": "DeviceUpdateClient.DeviceHealthState", "azure.iot.deviceupdate.models.HealthCheckResult": "DeviceUpdateClient.HealthCheckResult", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_import_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_delete_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_delete_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_providers": "DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_providers": "DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_names": "DeviceUpdateClient.DeviceUpdateOperationGroup.listNames", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_names": "DeviceUpdateClient.DeviceUpdateOperationGroup.listNames", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_versions": "DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_versions": "DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_files": "DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "DeviceUpdateClient.DeviceUpdateOperationGroup.getFile", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "DeviceUpdateClient.DeviceUpdateOperationGroup.getFile", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.update_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.update_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listDevices", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listDevices", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.begin_import_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.importDevices", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.begin_import_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.importDevices", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device": "DeviceUpdateClient.DeviceManagementOperationGroup.getDevice", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device": "DeviceUpdateClient.DeviceManagementOperationGroup.getDevice", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_module": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_module": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_groups": "DeviceUpdateClient.DeviceManagementOperationGroup.listGroups", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_groups": "DeviceUpdateClient.DeviceManagementOperationGroup.listGroups", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.create_or_update_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.create_or_update_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup" + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.getUpdate", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.getUpdate", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_delete_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.deleteUpdate", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_delete_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.deleteUpdate", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_providers": "Customization.ClientDeviceUpdateService.DeviceUpdate.listProviders", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_providers": "Customization.ClientDeviceUpdateService.DeviceUpdate.listProviders", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_names": "Customization.ClientDeviceUpdateService.DeviceUpdate.listNames", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_names": "Customization.ClientDeviceUpdateService.DeviceUpdate.listNames", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_versions": "Customization.ClientDeviceUpdateService.DeviceUpdate.listVersions", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_versions": "Customization.ClientDeviceUpdateService.DeviceUpdate.listVersions", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.update_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.updateDeviceClass", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.update_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.updateDeviceClass", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClass", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClass", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.listInstallableUpdatesForDeviceClass", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.listInstallableUpdatesForDeviceClass", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listDevices", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listDevices", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.begin_import_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.importDevices", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.begin_import_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.importDevices", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device": "Customization.ClientDeviceUpdateService.DeviceManagement.getDevice", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device": "Customization.ClientDeviceUpdateService.DeviceManagement.getDevice", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_module": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceModule", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_module": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceModule", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateCompliance", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateCompliance", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_groups": "Customization.ClientDeviceUpdateService.DeviceManagement.listGroups", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_groups": "Customization.ClientDeviceUpdateService.DeviceManagement.listGroups", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.create_or_update_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.createOrUpdateDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.create_or_update_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.createOrUpdateDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices" }, - "CrossLanguageVersion": "2152dadbc310" + "CrossLanguageVersion": "c1a73ac75a65" } \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py index c6963649810f..0b2f1892b1d6 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py @@ -28,12 +28,7 @@ class DeviceUpdateClient: - """Device Update for IoT Hub is an Azure service that enables customers to publish updates for - their IoT devices to the cloud, and then deploy that update to their devices (approve updates - to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and - reliability of the Windows Update platform, optimized for IoT devices. It works globally and - knows when and how to update devices, enabling customers to focus on their business goals and - let Device Update for IoT Hub handle the updates. + """DeviceUpdateClient. :ivar device_update: DeviceUpdateOperations operations :vartype device_update: azure.iot.deviceupdate.operations.DeviceUpdateOperations @@ -107,7 +102,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py index f3dc84c614e2..2431c67afc2c 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py @@ -29,9 +29,9 @@ class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attr :type credential: ~azure.core.credentials.TokenCredential :param instance_id: The Device Update for IoT Hub account instance identifier. Required. :type instance_id: str - :keyword api_version: The API version to use for this operation. Known values are "2026-06-01". - Default value is "2026-06-01". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-06-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py index 2485462aff3e..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py @@ -8,48 +8,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, List, Optional, TYPE_CHECKING -from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated - -if TYPE_CHECKING: - from azure.core.credentials import TokenCredential - - -class DeviceUpdateClient(DeviceUpdateClientGenerated): - """Device Update for IoT Hub client. - - This override preserves the constructor parameter order shipped in 1.0.0 - (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client - orders the hoisted ``instance_id`` after ``credential``; restoring the original - order here avoids a breaking change for existing callers. - - :param endpoint: The Device Update for IoT Hub account endpoint. Required. - :type endpoint: str - :param instance_id: The Device Update for IoT Hub account instance identifier. Required. - :type instance_id: str - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - endpoint: str, - instance_id: str, - credential: "TokenCredential", - *, - api_version: Optional[str] = None, - **kwargs: Any, - ) -> None: - if api_version is not None: - kwargs["api_version"] = api_version - super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) - - -__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py index bd5b9caf1022..1934415c1369 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py @@ -109,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -301,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -330,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -425,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -449,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -484,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -509,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -564,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py index a088671e9c51..75906e2eb77f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py @@ -520,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1109,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1381,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1393,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1954,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py index 0d79358c1d04..a9f9801b419f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py @@ -28,12 +28,7 @@ class DeviceUpdateClient: - """Device Update for IoT Hub is an Azure service that enables customers to publish updates for - their IoT devices to the cloud, and then deploy that update to their devices (approve updates - to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and - reliability of the Windows Update platform, optimized for IoT devices. It works globally and - knows when and how to update devices, enabling customers to focus on their business goals and - let Device Update for IoT Hub handle the updates. + """DeviceUpdateClient. :ivar device_update: DeviceUpdateOperations operations :vartype device_update: azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations @@ -109,7 +104,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py index 4ba8e0abc850..39d2645ab5a3 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py @@ -29,9 +29,9 @@ class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attr :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param instance_id: The Device Update for IoT Hub account instance identifier. Required. :type instance_id: str - :keyword api_version: The API version to use for this operation. Known values are "2026-06-01". - Default value is "2026-06-01". Note that overriding this default value may result in unsupported - behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-06-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py index 73feb5caa775..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py @@ -8,48 +8,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, List, Optional, TYPE_CHECKING -from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated - -if TYPE_CHECKING: - from azure.core.credentials_async import AsyncTokenCredential - - -class DeviceUpdateClient(DeviceUpdateClientGenerated): - """Device Update for IoT Hub async client. - - This override preserves the constructor parameter order shipped in 1.0.0 - (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client - orders the hoisted ``instance_id`` after ``credential``; restoring the original - order here avoids a breaking change for existing callers. - - :param endpoint: The Device Update for IoT Hub account endpoint. Required. - :type endpoint: str - :param instance_id: The Device Update for IoT Hub account instance identifier. Required. - :type instance_id: str - :param credential: Credential used to authenticate requests to the service. Required. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". - Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( - self, - endpoint: str, - instance_id: str, - credential: "AsyncTokenCredential", - *, - api_version: Optional[str] = None, - **kwargs: Any, - ) -> None: - if api_version is not None: - kwargs["api_version"] = api_version - super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) - - -__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py index 47aaedcfd5ad..72351924fada 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py @@ -33,7 +33,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import ( @@ -90,7 +90,6 @@ ) from .._configuration import DeviceUpdateClientConfiguration -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] @@ -210,7 +209,9 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) async def _import_update_initial( - self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any + self, + update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -305,7 +306,11 @@ async def begin_import_update( @overload async def begin_import_update( - self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any + self, + update_to_import: list[_types.ImportUpdateInputItem], + *, + content_type: str = "application/json", + **kwargs: Any ) -> AsyncLROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. @@ -314,7 +319,7 @@ async def begin_import_update( `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for details). Required. - :type update_to_import: list[JSON] + :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -345,7 +350,9 @@ async def begin_import_update( @distributed_trace_async async def begin_import_update( - self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any + self, + update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. @@ -353,9 +360,9 @@ async def begin_import_update( :param update_to_import: The update to be imported (see schema `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for - details). Is one of the following types: [ImportUpdateInputItem], [JSON], IO[bytes] Required. + details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or - list[JSON] or IO[bytes] + list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1498,7 +1505,7 @@ async def update_device_class( async def update_device_class( self, device_class_id: str, - device_class_patch: JSON, + device_class_patch: _types.PatchBody, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -1510,7 +1517,7 @@ async def update_device_class( :param device_class_patch: The device class json merge patch body. Currently only supports patching friendlyName. Required. - :type device_class_patch: JSON + :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -1546,7 +1553,10 @@ async def update_device_class( @distributed_trace_async async def update_device_class( - self, device_class_id: str, device_class_patch: Union[_models.PatchBody, JSON, IO[bytes]], **kwargs: Any + self, + device_class_id: str, + device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], + **kwargs: Any ) -> _models.DeviceClass: """Update device class details. @@ -1554,8 +1564,9 @@ async def update_device_class( :type device_class_id: str :param device_class_patch: The device class json merge patch body. Currently only supports patching - friendlyName. Is one of the following types: PatchBody, JSON, IO[bytes] Required. - :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or JSON or IO[bytes] + friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. + :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or + ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] :return: DeviceClass. The DeviceClass is compatible with MutableMapping :rtype: ~azure.iot.deviceupdate.models.DeviceClass :raises ~azure.core.exceptions.HttpResponseError: @@ -2775,7 +2786,7 @@ async def create_or_update_deployment( self, group_id: str, deployment_id: str, - deployment: JSON, + deployment: _types.Deployment, *, content_type: str = "application/json", **kwargs: Any @@ -2787,7 +2798,7 @@ async def create_or_update_deployment( :param deployment_id: Deployment identifier. Required. :type deployment_id: str :param deployment: The deployment properties. Required. - :type deployment: JSON + :type deployment: ~azure.iot.deviceupdate.types.Deployment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2824,7 +2835,11 @@ async def create_or_update_deployment( @distributed_trace_async async def create_or_update_deployment( - self, group_id: str, deployment_id: str, deployment: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any + self, + group_id: str, + deployment_id: str, + deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], + **kwargs: Any ) -> _models.Deployment: """Creates or updates a deployment. @@ -2832,9 +2847,10 @@ async def create_or_update_deployment( :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :param deployment: The deployment properties. Is one of the following types: Deployment, JSON, - IO[bytes] Required. - :type deployment: ~azure.iot.deviceupdate.models.Deployment or JSON or IO[bytes] + :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. + Required. + :type deployment: ~azure.iot.deviceupdate.models.Deployment or + ~azure.iot.deviceupdate.types.Deployment or IO[bytes] :return: Deployment. The Deployment is compatible with MutableMapping :rtype: ~azure.iot.deviceupdate.models.Deployment :raises ~azure.core.exceptions.HttpResponseError: @@ -2906,6 +2922,62 @@ async def create_or_update_deployment( return deserialized # type: ignore + @distributed_trace_async + async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> None: + """Deletes a deployment. + + :param group_id: Group identifier. Required. + :type group_id: str + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_device_management_delete_deployment_request( + group_id=group_id, + deployment_id=deployment_id, + instance_id=self._config.instance_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + @distributed_trace_async async def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: """Gets the status of a deployment including a breakdown of how many devices in the deployment are @@ -3533,6 +3605,67 @@ async def get_deployment_for_device_class_subgroup( return deserialized # type: ignore + @distributed_trace_async + async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-too-long + self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any + ) -> None: + """Deletes a device class subgroup deployment. + + :param group_id: Group identifier. Required. + :type group_id: str + :param device_class_id: Device class identifier. Required. + :type device_class_id: str + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_device_management_delete_deployment_for_device_class_subgroup_request( + group_id=group_id, + device_class_id=device_class_id, + deployment_id=deployment_id, + instance_id=self._config.instance_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + @distributed_trace_async async def stop_deployment( self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any @@ -4078,14 +4211,19 @@ async def start_log_collection( @overload async def start_log_collection( - self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + log_collection_id: str, + log_collection: _types.LogCollection, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.LogCollection: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str :param log_collection: The log collection properties. Required. - :type log_collection: JSON + :type log_collection: ~azure.iot.deviceupdate.types.LogCollection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4119,15 +4257,19 @@ async def start_log_collection( @distributed_trace_async async def start_log_collection( - self, log_collection_id: str, log_collection: Union[_models.LogCollection, JSON, IO[bytes]], **kwargs: Any + self, + log_collection_id: str, + log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], + **kwargs: Any ) -> _models.LogCollection: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :param log_collection: The log collection properties. Is one of the following types: - LogCollection, JSON, IO[bytes] Required. - :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or JSON or IO[bytes] + :param log_collection: The log collection properties. Is either a LogCollection type or a + IO[bytes] type. Required. + :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or + ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] :return: LogCollection. The LogCollection is compatible with MutableMapping :rtype: ~azure.iot.deviceupdate.models.LogCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -4514,120 +4656,3 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> None: - """Deletes a deployment. - - :param group_id: Group identifier. Required. - :type group_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_device_management_delete_deployment_request( - group_id=group_id, - deployment_id=deployment_id, - instance_id=self._config.instance_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-too-long - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> None: - """Deletes a device class subgroup deployment. - - :param group_id: Group identifier. Required. - :type group_id: str - :param device_class_id: Device class identifier. Required. - :type device_class_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_device_management_delete_deployment_for_device_class_subgroup_request( - group_id=group_id, - device_class_id=device_class_id, - deployment_id=deployment_id, - instance_id=self._config.instance_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py index 0cc01201197f..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py @@ -8,94 +8,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, List, Optional -from azure.core import MatchConditions - -from ._operations import ( - DeviceManagementOperations as DeviceManagementOperationsGenerated, - DeviceUpdateOperations as DeviceUpdateOperationsGenerated, -) - - -def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: - """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw - ``If-None-Match`` header value as-is (the generated client instead exposes the - ``etag`` / ``match_condition`` pattern). - - :param kwargs: The keyword arguments forwarded to the generated operation. - :type kwargs: any - :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. - :type if_none_match: str or None - """ - if if_none_match is not None: - headers = kwargs.setdefault("headers", {}) - headers.setdefault("If-None-Match", if_none_match) - - -class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): - async def get_update( - self, - provider: str, - name: str, - version: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return await super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) - - async def get_file( - self, - provider: str, - name: str, - version: str, - file_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return await super().get_file( - provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs - ) - - async def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) - - -class DeviceManagementOperations(DeviceManagementOperationsGenerated): - async def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) - - -__all__: List[str] = [ - "DeviceUpdateOperations", - "DeviceManagementOperations", -] # Add all objects you want publicly available at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py index 44b7f9e90718..399aa0d59b77 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py @@ -32,13 +32,12 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import DeviceUpdateClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer from .._utils.utils import prep_if_match, prep_if_none_match -JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] @@ -877,6 +876,28 @@ def build_device_management_create_or_update_deployment_request( # pylint: disa return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) +def build_device_management_delete_deployment_request( # pylint: disable=name-too-long + group_id: str, deployment_id: str, instance_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) + # Construct URL + _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}" + path_format_arguments = { + "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), + "groupId": _SERIALIZER.url("group_id", group_id, "str"), + "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + def build_device_management_get_deployment_status_request( # pylint: disable=name-too-long group_id: str, deployment_id: str, instance_id: str, **kwargs: Any ) -> HttpRequest: @@ -1101,6 +1122,29 @@ def build_device_management_get_deployment_for_device_class_subgroup_request( # return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_device_management_delete_deployment_for_device_class_subgroup_request( # pylint: disable=name-too-long + group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) + # Construct URL + _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}" + path_format_arguments = { + "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), + "groupId": _SERIALIZER.url("group_id", group_id, "str"), + "deviceClassId": _SERIALIZER.url("device_class_id", device_class_id, "str"), + "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + def build_device_management_stop_deployment_request( # pylint: disable=name-too-long group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any ) -> HttpRequest: @@ -1430,51 +1474,6 @@ def build_device_management_list_health_of_devices_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_device_management_delete_deployment_request( # pylint: disable=name-too-long - group_id: str, deployment_id: str, instance_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) - # Construct URL - _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}" - path_format_arguments = { - "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), - "groupId": _SERIALIZER.url("group_id", group_id, "str"), - "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_device_management_delete_deployment_for_device_class_subgroup_request( # pylint: disable=name-too-long - group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) - # Construct URL - _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}" - path_format_arguments = { - "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), - "groupId": _SERIALIZER.url("group_id", group_id, "str"), - "deviceClassId": _SERIALIZER.url("device_class_id", device_class_id, "str"), - "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - class DeviceUpdateOperations: """ .. warning:: @@ -1590,7 +1589,9 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) def _import_update_initial( - self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any + self, + update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1685,7 +1686,11 @@ def begin_import_update( @overload def begin_import_update( - self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any + self, + update_to_import: list[_types.ImportUpdateInputItem], + *, + content_type: str = "application/json", + **kwargs: Any ) -> LROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. @@ -1694,7 +1699,7 @@ def begin_import_update( `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for details). Required. - :type update_to_import: list[JSON] + :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1725,7 +1730,9 @@ def begin_import_update( @distributed_trace def begin_import_update( - self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any + self, + update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], + **kwargs: Any ) -> LROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. @@ -1733,9 +1740,9 @@ def begin_import_update( :param update_to_import: The update to be imported (see schema `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for - details). Is one of the following types: [ImportUpdateInputItem], [JSON], IO[bytes] Required. + details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or - list[JSON] or IO[bytes] + list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2870,7 +2877,7 @@ def update_device_class( def update_device_class( self, device_class_id: str, - device_class_patch: JSON, + device_class_patch: _types.PatchBody, *, content_type: str = "application/merge-patch+json", **kwargs: Any @@ -2882,7 +2889,7 @@ def update_device_class( :param device_class_patch: The device class json merge patch body. Currently only supports patching friendlyName. Required. - :type device_class_patch: JSON + :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str @@ -2918,7 +2925,10 @@ def update_device_class( @distributed_trace def update_device_class( - self, device_class_id: str, device_class_patch: Union[_models.PatchBody, JSON, IO[bytes]], **kwargs: Any + self, + device_class_id: str, + device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], + **kwargs: Any ) -> _models.DeviceClass: """Update device class details. @@ -2926,8 +2936,9 @@ def update_device_class( :type device_class_id: str :param device_class_patch: The device class json merge patch body. Currently only supports patching - friendlyName. Is one of the following types: PatchBody, JSON, IO[bytes] Required. - :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or JSON or IO[bytes] + friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. + :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or + ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] :return: DeviceClass. The DeviceClass is compatible with MutableMapping :rtype: ~azure.iot.deviceupdate.models.DeviceClass :raises ~azure.core.exceptions.HttpResponseError: @@ -4144,7 +4155,7 @@ def create_or_update_deployment( self, group_id: str, deployment_id: str, - deployment: JSON, + deployment: _types.Deployment, *, content_type: str = "application/json", **kwargs: Any @@ -4156,7 +4167,7 @@ def create_or_update_deployment( :param deployment_id: Deployment identifier. Required. :type deployment_id: str :param deployment: The deployment properties. Required. - :type deployment: JSON + :type deployment: ~azure.iot.deviceupdate.types.Deployment :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4193,7 +4204,11 @@ def create_or_update_deployment( @distributed_trace def create_or_update_deployment( - self, group_id: str, deployment_id: str, deployment: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any + self, + group_id: str, + deployment_id: str, + deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], + **kwargs: Any ) -> _models.Deployment: """Creates or updates a deployment. @@ -4201,9 +4216,10 @@ def create_or_update_deployment( :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :param deployment: The deployment properties. Is one of the following types: Deployment, JSON, - IO[bytes] Required. - :type deployment: ~azure.iot.deviceupdate.models.Deployment or JSON or IO[bytes] + :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. + Required. + :type deployment: ~azure.iot.deviceupdate.models.Deployment or + ~azure.iot.deviceupdate.types.Deployment or IO[bytes] :return: Deployment. The Deployment is compatible with MutableMapping :rtype: ~azure.iot.deviceupdate.models.Deployment :raises ~azure.core.exceptions.HttpResponseError: @@ -4275,6 +4291,64 @@ def create_or_update_deployment( return deserialized # type: ignore + @distributed_trace + def delete_deployment( # pylint: disable=inconsistent-return-statements + self, group_id: str, deployment_id: str, **kwargs: Any + ) -> None: + """Deletes a deployment. + + :param group_id: Group identifier. Required. + :type group_id: str + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_device_management_delete_deployment_request( + group_id=group_id, + deployment_id=deployment_id, + instance_id=self._config.instance_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + @distributed_trace def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: """Gets the status of a deployment including a breakdown of how many devices in the deployment are @@ -4903,6 +4977,67 @@ def get_deployment_for_device_class_subgroup( return deserialized # type: ignore + @distributed_trace + def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent-return-statements,name-too-long + self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any + ) -> None: + """Deletes a device class subgroup deployment. + + :param group_id: Group identifier. Required. + :type group_id: str + :param device_class_id: Device class identifier. Required. + :type device_class_id: str + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_device_management_delete_deployment_for_device_class_subgroup_request( + group_id=group_id, + device_class_id=device_class_id, + deployment_id=deployment_id, + instance_id=self._config.instance_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + @distributed_trace def stop_deployment( self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any @@ -5447,14 +5582,19 @@ def start_log_collection( @overload def start_log_collection( - self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any + self, + log_collection_id: str, + log_collection: _types.LogCollection, + *, + content_type: str = "application/json", + **kwargs: Any ) -> _models.LogCollection: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str :param log_collection: The log collection properties. Required. - :type log_collection: JSON + :type log_collection: ~azure.iot.deviceupdate.types.LogCollection :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5488,15 +5628,19 @@ def start_log_collection( @distributed_trace def start_log_collection( - self, log_collection_id: str, log_collection: Union[_models.LogCollection, JSON, IO[bytes]], **kwargs: Any + self, + log_collection_id: str, + log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], + **kwargs: Any ) -> _models.LogCollection: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :param log_collection: The log collection properties. Is one of the following types: - LogCollection, JSON, IO[bytes] Required. - :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or JSON or IO[bytes] + :param log_collection: The log collection properties. Is either a LogCollection type or a + IO[bytes] type. Required. + :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or + ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] :return: LogCollection. The LogCollection is compatible with MutableMapping :rtype: ~azure.iot.deviceupdate.models.LogCollection :raises ~azure.core.exceptions.HttpResponseError: @@ -5883,122 +6027,3 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) - - @distributed_trace - def delete_deployment( # pylint: disable=inconsistent-return-statements - self, group_id: str, deployment_id: str, **kwargs: Any - ) -> None: - """Deletes a deployment. - - :param group_id: Group identifier. Required. - :type group_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_device_management_delete_deployment_request( - group_id=group_id, - deployment_id=deployment_id, - instance_id=self._config.instance_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent-return-statements,name-too-long - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> None: - """Deletes a device class subgroup deployment. - - :param group_id: Group identifier. Required. - :type group_id: str - :param device_class_id: Device class identifier. Required. - :type device_class_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_device_management_delete_deployment_for_device_class_subgroup_request( - group_id=group_id, - device_class_id=device_class_id, - deployment_id=deployment_id, - instance_id=self._config.instance_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py index dd6b7c08adf4..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py @@ -8,92 +8,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, List, Optional -from azure.core import MatchConditions - -from ._operations import ( - DeviceManagementOperations as DeviceManagementOperationsGenerated, - DeviceUpdateOperations as DeviceUpdateOperationsGenerated, -) - - -def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: - """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw - ``If-None-Match`` header value as-is (the generated client instead exposes the - ``etag`` / ``match_condition`` pattern). - - :param kwargs: The keyword arguments forwarded to the generated operation. - :type kwargs: any - :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. - :type if_none_match: str or None - """ - if if_none_match is not None: - headers = kwargs.setdefault("headers", {}) - headers.setdefault("If-None-Match", if_none_match) - - -class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): - def get_update( - self, - provider: str, - name: str, - version: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) - - def get_file( - self, - provider: str, - name: str, - version: str, - file_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return super().get_file(provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs) - - def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) - - -class DeviceManagementOperations(DeviceManagementOperationsGenerated): - def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = None, - match_condition: Optional[MatchConditions] = None, - if_none_match: Optional[str] = None, - **kwargs: Any, - ): - _apply_if_none_match(kwargs, if_none_match) - return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) - - -__all__: List[str] = [ - "DeviceUpdateOperations", - "DeviceManagementOperations", -] # Add all objects you want publicly available at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py new file mode 100644 index 000000000000..c198e1ee1c7c --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py @@ -0,0 +1,269 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import DownloadSecurity, OperationStatus + + +class CloudInitiatedRollbackPolicy(TypedDict, total=False): + """Rollback policy for deployment. + + :ivar update_property: Update to rollback to. Required. + :vartype update_property: "UpdateInfo" + :ivar failure: Failure conditions to initiate rollback policy. Required. + :vartype failure: "CloudInitiatedRollbackPolicyFailure" + """ + + update: Required["UpdateInfo"] + """Update to rollback to. Required.""" + failure: Required["CloudInitiatedRollbackPolicyFailure"] + """Failure conditions to initiate rollback policy. Required.""" + + +class CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): + """Failure conditions to initiate rollback policy. + + :ivar devices_failed_percentage: Percentage of devices that failed. Required. + :vartype devices_failed_percentage: int + :ivar devices_failed_count: Number of devices that failed. Required. + :vartype devices_failed_count: int + """ + + devicesFailedPercentage: Required[int] + """Percentage of devices that failed. Required.""" + devicesFailedCount: Required[int] + """Number of devices that failed. Required.""" + + +class Deployment(TypedDict, total=False): + """Deployment metadata. + + :ivar deployment_id: The caller-provided deployment identifier. This cannot be longer than 73 + characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', + '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub + resource generates a GUID for deploymentId when you create a deployment. Required. + :vartype deployment_id: str + :ivar start_date_time: The deployment start datetime. Required. + :vartype start_date_time: str + :ivar update_property: Update information for the update in the deployment. Required. + :vartype update_property: "UpdateInfo" + :ivar group_id: The group identity for the devices the deployment is intended to update. + Required. + :vartype group_id: str + :ivar device_class_subgroups: The device class subgroups the deployment is compatible with and + subgroup deployments have been created for. This is not provided by the caller during + CreateOrUpdateDeployment but is automatically determined by Device Update. + :vartype device_class_subgroups: list[str] + :ivar is_canceled: Boolean flag indicating whether the deployment was canceled. + :vartype is_canceled: bool + :ivar is_retried: Boolean flag indicating whether the deployment has been retried. + :vartype is_retried: bool + :ivar rollback_policy: The rollback policy for the deployment. + :vartype rollback_policy: "CloudInitiatedRollbackPolicy" + :ivar is_cloud_initiated_rollback: Boolean flag indicating whether the deployment is a rollback + deployment. + :vartype is_cloud_initiated_rollback: bool + :ivar download_security: The protocol the device should use when downloading the update + payload. Defaults to "https". Known values are: "https" and "http". + :vartype download_security: Union[str, "DownloadSecurity"] + """ + + deploymentId: Required[str] + """The caller-provided deployment identifier. This cannot be longer than 73 characters, must be + all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, + backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a + GUID for deploymentId when you create a deployment. Required.""" + startDateTime: Required[str] + """The deployment start datetime. Required.""" + update: Required["UpdateInfo"] + """Update information for the update in the deployment. Required.""" + groupId: Required[str] + """The group identity for the devices the deployment is intended to update. Required.""" + deviceClassSubgroups: list[str] + """The device class subgroups the deployment is compatible with and subgroup deployments have been + created for. This is not provided by the caller during CreateOrUpdateDeployment but is + automatically determined by Device Update.""" + isCanceled: bool + """Boolean flag indicating whether the deployment was canceled.""" + isRetried: bool + """Boolean flag indicating whether the deployment has been retried.""" + rollbackPolicy: "CloudInitiatedRollbackPolicy" + """The rollback policy for the deployment.""" + isCloudInitiatedRollback: bool + """Boolean flag indicating whether the deployment is a rollback deployment.""" + downloadSecurity: Union[str, "DownloadSecurity"] + """The protocol the device should use when downloading the update payload. Defaults to \"https\". + Known values are: \"https\" and \"http\".""" + + +class DeviceUpdateAgentId(TypedDict, total=False): + """Device Update agent id. + + :ivar device_id: Device Id. Required. + :vartype device_id: str + :ivar module_id: Module Id. + :vartype module_id: str + """ + + deviceId: Required[str] + """Device Id. Required.""" + moduleId: str + """Module Id.""" + + +class FileImportMetadata(TypedDict, total=False): + """Metadata describing an update file. + + :ivar filename: Update file name as specified inside import manifest. Required. + :vartype filename: str + :ivar url: Azure Blob location from which the update file can be downloaded by Device Update + for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at + least 4 hours. Required. + :vartype url: str + """ + + filename: Required[str] + """Update file name as specified inside import manifest. Required.""" + url: Required[str] + """Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. + This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 + hours. Required.""" + + +class ImportManifestMetadata(TypedDict, total=False): + """Metadata describing the import manifest, a document which describes the files and other + metadata about an update version. + + :ivar url: Azure Blob location from which the import manifest can be downloaded by Device + Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set + to at least 4 hours. Required. + :vartype url: str + :ivar size_in_bytes: File size in number of bytes. Required. + :vartype size_in_bytes: int + :ivar hashes: A JSON object containing the hash(es) of the file. At least SHA256 hash is + required. This object can be thought of as a set of key-value pairs where the key is the hash + algorithm, and the value is the hash of the file calculated using that algorithm. Required. + :vartype hashes: dict[str, str] + """ + + url: Required[str] + """Azure Blob location from which the import manifest can be downloaded by Device Update for IoT + Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 + hours. Required.""" + sizeInBytes: Required[int] + """File size in number of bytes. Required.""" + hashes: Required[dict[str, str]] + """A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This + object can be thought of as a set of key-value pairs where the key is the hash algorithm, and + the value is the hash of the file calculated using that algorithm. Required.""" + + +class ImportUpdateInputItem(TypedDict, total=False): + """Import update input item metadata. + + :ivar import_manifest: Import manifest metadata like source URL, file size/hashes, etc. + Required. + :vartype import_manifest: "ImportManifestMetadata" + :ivar friendly_name: Friendly update name. + :vartype friendly_name: str + :ivar files: One or more update file properties like filename and source URL. + :vartype files: list["FileImportMetadata"] + """ + + importManifest: Required["ImportManifestMetadata"] + """Import manifest metadata like source URL, file size/hashes, etc. Required.""" + friendlyName: str + """Friendly update name.""" + files: list["FileImportMetadata"] + """One or more update file properties like filename and source URL.""" + + +class LogCollection(TypedDict, total=False): + """Diagnostics request body. + + :ivar log_collection_id: The log collection id. + :vartype log_collection_id: str + :ivar device_list: Array of Device Update agent ids. Required. + :vartype device_list: list["DeviceUpdateAgentId"] + :ivar description: Description of the diagnostics operation. + :vartype description: str + :ivar created_date_time: The timestamp when the operation was created. + :vartype created_date_time: str + :ivar last_action_date_time: A timestamp for when the current state was entered. + :vartype last_action_date_time: str + :ivar status: Operation status. Known values are: "NotStarted", "Running", "Succeeded", and + "Failed". + :vartype status: Union[str, "OperationStatus"] + """ + + operationId: str + """The log collection id.""" + deviceList: Required[list["DeviceUpdateAgentId"]] + """Array of Device Update agent ids. Required.""" + description: str + """Description of the diagnostics operation.""" + createdDateTime: str + """The timestamp when the operation was created.""" + lastActionDateTime: str + """A timestamp for when the current state was entered.""" + status: Union[str, "OperationStatus"] + """Operation status. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and \"Failed\".""" + + +class PatchBody(TypedDict, total=False): + """Device Class JSON Merge Patch request body. + + :ivar friendly_name: The device class friendly name. Friendly name can be 1-100 characters, + alphanumeric, dot, and dash. Required. + :vartype friendly_name: str + """ + + friendlyName: Required[str] + """The device class friendly name. Friendly name can be 1-100 characters, alphanumeric, dot, and + dash. Required.""" + + +class UpdateId(TypedDict, total=False): + """Update identifier. + + :ivar provider: Update provider. Required. + :vartype provider: str + :ivar name: Update name. Required. + :vartype name: str + :ivar version: Update version. Required. + :vartype version: str + """ + + provider: Required[str] + """Update provider. Required.""" + name: Required[str] + """Update name. Required.""" + version: Required[str] + """Update version. Required.""" + + +class UpdateInfo(TypedDict, total=False): + """Update information. + + :ivar update_id: Update identifier. Required. + :vartype update_id: "UpdateId" + :ivar description: Update description. + :vartype description: str + :ivar friendly_name: Friendly update name. + :vartype friendly_name: str + """ + + updateId: Required["UpdateId"] + """Update identifier. Required.""" + description: str + """Update description.""" + friendlyName: str + """Friendly update name.""" diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml index a77c2ee731f1..211c5f15ddab 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml @@ -1,19 +1,23 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + [build-system] -requires = [ - "setuptools>=77.0.3", - "wheel", -] +requires = ["setuptools>=77.0.3", "wheel"] build-backend = "setuptools.build_meta" [project] name = "azure-iot-deviceupdate" authors = [ - { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ] description = "Microsoft Corporation Azure Iot Deviceupdate Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -24,32 +28,23 @@ classifiers = [ "Programming Language :: Python :: 3.14", ] requires-python = ">=3.10" -keywords = [ - "azure", - "azure sdk", -] +keywords = ["azure", "azure sdk"] + dependencies = [ "isodate>=0.6.1", "azure-core>=1.37.0", "typing-extensions>=4.6.0", ] dynamic = [ - "version", - "readme", +"version", "readme" ] [project.urls] repository = "https://github.com/Azure/azure-sdk-for-python" -[tool.setuptools.dynamic.version] -attr = "azure.iot.deviceupdate._version.VERSION" - -[tool.setuptools.dynamic.readme] -file = [ - "README.md", - "CHANGELOG.md", -] -content-type = "text/markdown" +[tool.setuptools.dynamic] +version = {attr = "azure.iot.deviceupdate._version.VERSION"} +readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} [tool.setuptools.packages.find] exclude = [ @@ -63,9 +58,7 @@ exclude = [ ] [tool.setuptools.package-data] -pytyped = [ - "py.typed", -] +pytyped = ["py.typed"] [tool.azure-sdk-build] pyright = false diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml index dfe6b1560ec3..f8595069c1f6 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/deviceupdate/data-plane/duiothub -commit: 292231b1131ff9fd070377372a0647c6ac7a6ce2 +commit: 67ffbb6bee462e36bcdd3b93cffca6942c3a35f7 repo: Azure/azure-rest-api-specs additionalDirectories: From ee326b807f5c60e407779b400bf0c46617645cfc Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Thu, 30 Jul 2026 15:22:00 -0400 Subject: [PATCH 02/11] Align deviceupdate public API with 1.0.0b3 --- .../azure-iot-deviceupdate/api.md | 2490 +++++------------ .../azure-iot-deviceupdate/api.metadata.yml | 2 +- .../apiview-properties.json | 108 +- .../azure/iot/deviceupdate/_patch.py | 9 + .../azure/iot/deviceupdate/aio/_patch.py | 9 + .../iot/deviceupdate/aio/operations/_patch.py | 197 ++ .../azure/iot/deviceupdate/models/_patch.py | 3 + .../iot/deviceupdate/operations/_patch.py | 192 ++ 8 files changed, 1139 insertions(+), 1871 deletions(-) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.md b/sdk/deviceupdate/azure-iot-deviceupdate/api.md index 3df29b42d692..42dced2340e6 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.md @@ -6,26 +6,22 @@ namespace azure.iot.deviceupdate device_update: DeviceUpdateOperations def __init__( - self, - endpoint: str, - credential: TokenCredential, - instance_id: str, - *, - api_version: str = ..., - polling_interval: Optional[int] = ..., + self, + endpoint: str, + instance_id: str, + credential: 'TokenCredential', **kwargs: Any ) -> None: ... - def close(self) -> None: ... - def send_request( - self, - request: HttpRequest, - *, - stream: bool = False, + self, + request: HttpRequest, **kwargs: Any ) -> HttpResponse: ... + def close( + self + ) -> None: ... namespace azure.iot.deviceupdate.aio @@ -34,1444 +30,499 @@ namespace azure.iot.deviceupdate.aio device_update: DeviceUpdateOperations def __init__( - self, - endpoint: str, - credential: AsyncTokenCredential, - instance_id: str, - *, - api_version: str = ..., - polling_interval: Optional[int] = ..., + self, + endpoint: str, + instance_id: str, + credential: 'AsyncTokenCredential', **kwargs: Any ) -> None: ... - async def close(self) -> None: ... - def send_request( - self, - request: HttpRequest, - *, - stream: bool = False, + self, + request: HttpRequest, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: ... + async def close( + self + ) -> None: ... namespace azure.iot.deviceupdate.aio.operations class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations: def __init__( - self, - *args, + self, + *args, **kwargs ) -> None: ... - @distributed_trace_async - async def begin_import_devices( - self, - import_type: Union[str, ImportType], + @distributed_trace + def list_device_classes( + self, **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> AsyncIterable[JSON]: ... - @overload - async def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: Deployment, - *, - content_type: str = "application/json", + @distributed_trace_async + async def get_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> Deployment: ... + ) -> JSON: ... @overload - async def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: Deployment, - *, - content_type: str = "application/json", + async def update_device_class( + self, + device_class_id: str, + device_class_patch: JSON, + *, + content_type: str = 'application/merge-patch+json', **kwargs: Any - ) -> Deployment: ... + ) -> JSON: ... @overload - async def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Deployment: ... - - @distributed_trace_async - async def delete_deployment( - self, - group_id: str, - deployment_id: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def delete_deployment_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + async def update_device_class( + self, + device_class_id: str, + device_class_patch: IO, + *, + content_type: str = 'application/merge-patch+json', **kwargs: Any - ) -> None: ... + ) -> JSON: ... @distributed_trace_async async def delete_device_class( - self, - device_class_id: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def delete_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - **kwargs: Any - ) -> None: ... - - @distributed_trace_async - async def delete_group( - self, - group_id: str, + self, + device_class_id: str, **kwargs: Any ) -> None: ... - @distributed_trace_async - async def get_best_updates_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - **kwargs: Any - ) -> DeviceClassSubgroupUpdatableDevices: ... - - @distributed_trace_async - async def get_deployment( - self, - group_id: str, - deployment_id: str, + @distributed_trace + def list_installable_updates_for_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> Deployment: ... + ) -> AsyncIterable[JSON]: ... - @distributed_trace_async - async def get_deployment_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + @distributed_trace + def list_devices( + self, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> Deployment: ... + ) -> AsyncIterable[JSON]: ... @distributed_trace_async - async def get_deployment_status( - self, - group_id: str, - deployment_id: str, + async def begin_import_devices( + self, + import_type: str, **kwargs: Any - ) -> DeploymentStatus: ... + ) -> AsyncLROPoller[None]: ... @distributed_trace_async async def get_device( - self, - device_id: str, + self, + device_id: str, **kwargs: Any - ) -> Device: ... - - @distributed_trace_async - async def get_device_class( - self, - device_class_id: str, - **kwargs: Any - ) -> DeviceClass: ... - - @distributed_trace_async - async def get_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - **kwargs: Any - ) -> DeviceClassSubgroup: ... - - @distributed_trace_async - async def get_device_class_subgroup_deployment_status( - self, - group_id: str, - device_class_id: str, - deployment_id: str, - **kwargs: Any - ) -> DeviceClassSubgroupDeploymentStatus: ... - - @distributed_trace_async - async def get_device_class_subgroup_update_compliance( - self, - group_id: str, - device_class_id: str, - **kwargs: Any - ) -> UpdateCompliance: ... + ) -> JSON: ... @distributed_trace_async async def get_device_module( - self, - device_id: str, - module_id: str, - **kwargs: Any - ) -> Device: ... - - @distributed_trace_async - async def get_group( - self, - group_id: str, - **kwargs: Any - ) -> Group: ... - - @distributed_trace_async - async def get_log_collection( - self, - log_collection_id: str, - **kwargs: Any - ) -> LogCollection: ... - - @distributed_trace_async - async def get_log_collection_detailed_status( - self, - log_collection_id: str, - **kwargs: Any - ) -> LogCollectionOperationDetailedStatus: ... - - @distributed_trace_async - async def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + self, + device_id: str, + module_id: str, **kwargs: Any - ) -> DeviceOperation: ... - - @distributed_trace_async - async def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... + ) -> JSON: ... @distributed_trace_async - async def get_update_compliance_for_group( - self, - group_id: str, - **kwargs: Any - ) -> UpdateCompliance: ... - - @distributed_trace - def list_best_updates_for_group( - self, - group_id: str, + async def get_update_compliance( + self, **kwargs: Any - ) -> AsyncItemPaged[DeviceClassSubgroupUpdatableDevices]: ... - - @distributed_trace - def list_deployments_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - *, - order_by: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[Deployment]: ... - - @distributed_trace - def list_deployments_for_group( - self, - group_id: str, - *, - order_by: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[Deployment]: ... - - @distributed_trace - def list_device_class_subgroups_for_group( - self, - group_id: str, - *, - filter: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[DeviceClassSubgroup]: ... - - @distributed_trace - def list_device_classes( - self, - *, - filter: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[DeviceClass]: ... - - @distributed_trace - def list_device_states_for_device_class_subgroup_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, - *, - filter: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[DeploymentDeviceState]: ... - - @distributed_trace - def list_devices( - self, - *, - filter: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[Device]: ... + ) -> JSON: ... @distributed_trace def list_groups( - self, - *, - order_by: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[Group]: ... - - @distributed_trace - def list_health_of_devices( - self, - *, - filter: str, - **kwargs: Any - ) -> AsyncItemPaged[DeviceHealth]: ... - - @distributed_trace - def list_installable_updates_for_device_class( - self, - device_class_id: str, - **kwargs: Any - ) -> AsyncItemPaged[UpdateInfo]: ... - - @distributed_trace - def list_log_collections(self, **kwargs: Any) -> AsyncItemPaged[LogCollection]: ... - - @distributed_trace - def list_operation_statuses( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., - **kwargs: Any - ) -> AsyncItemPaged[DeviceOperation]: ... - - @distributed_trace_async - async def retry_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, - **kwargs: Any - ) -> Deployment: ... - - @overload - async def start_log_collection( - self, - log_collection_id: str, - log_collection: LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LogCollection: ... - - @overload - async def start_log_collection( - self, - log_collection_id: str, - log_collection: LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LogCollection: ... - - @overload - async def start_log_collection( - self, - log_collection_id: str, - log_collection: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LogCollection: ... - - @distributed_trace_async - async def stop_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, - **kwargs: Any - ) -> Deployment: ... - - @overload - async def update_device_class( - self, - device_class_id: str, - device_class_patch: PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> DeviceClass: ... - - @overload - async def update_device_class( - self, - device_class_id: str, - device_class_patch: PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> DeviceClass: ... - - @overload - async def update_device_class( - self, - device_class_id: str, - device_class_patch: IO[bytes], - *, - content_type: str = "application/merge-patch+json", + self, + *, + orderby: Optional[str] = ..., **kwargs: Any - ) -> DeviceClass: ... - - - class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations: - - def __init__( - self, - *args, - **kwargs - ) -> None: ... + ) -> AsyncIterable[JSON]: ... @distributed_trace_async - async def begin_delete_update( - self, - provider: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_import_update( - self, - update_to_import: list[ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_import_update( - self, - update_to_import: list[ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @overload - async def begin_import_update( - self, - update_to_import: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - - @distributed_trace_async - async def get_file( - self, - provider: str, - name: str, - version: str, - file_id: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> UpdateFile: ... - - @distributed_trace_async - async def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + async def get_group( + self, + group_id: str, **kwargs: Any - ) -> UpdateOperation: ... + ) -> JSON: ... @distributed_trace_async - async def get_update( - self, - provider: str, - name: str, - version: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any - ) -> Update: ... - - @distributed_trace - def list_files( - self, - provider: str, - name: str, - version: str, - **kwargs: Any - ) -> AsyncItemPaged[str]: ... - - @distributed_trace - def list_names( - self, - provider: str, - **kwargs: Any - ) -> AsyncItemPaged[str]: ... - - @distributed_trace - def list_operation_statuses( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., - **kwargs: Any - ) -> AsyncItemPaged[UpdateOperation]: ... - - @distributed_trace - def list_providers(self, **kwargs: Any) -> AsyncItemPaged[str]: ... - - @distributed_trace - def list_updates( - self, - *, - filter: Optional[str] = ..., - search: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[Update]: ... - - @distributed_trace - def list_versions( - self, - provider: str, - name: str, - *, - filter: Optional[str] = ..., - **kwargs: Any - ) -> AsyncItemPaged[str]: ... - - -namespace azure.iot.deviceupdate.models - - class azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy(_Model): - failure: CloudInitiatedRollbackPolicyFailure - update_property: UpdateInfo - - @overload - def __init__( - self, - *, - failure: CloudInitiatedRollbackPolicyFailure, - update_property: UpdateInfo - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure(_Model): - devices_failed_count: int - devices_failed_percentage: int - - @overload - def __init__( - self, - *, - devices_failed_count: int, - devices_failed_percentage: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.Compatibility(_Model): - - - class azure.iot.deviceupdate.models.ContractModel(_Model): - id: str - name: str - - @overload - def __init__( - self, - *, - id: str, - name: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.Deployment(_Model): - deployment_id: str - device_class_subgroups: Optional[list[str]] - download_security: Optional[Union[str, DownloadSecurity]] - group_id: str - is_canceled: Optional[bool] - is_cloud_initiated_rollback: Optional[bool] - is_retried: Optional[bool] - rollback_policy: Optional[CloudInitiatedRollbackPolicy] - start_date_time: datetime - update_property: UpdateInfo - - @overload - def __init__( - self, - *, - deployment_id: str, - device_class_subgroups: Optional[list[str]] = ..., - download_security: Optional[Union[str, DownloadSecurity]] = ..., - group_id: str, - is_canceled: Optional[bool] = ..., - is_cloud_initiated_rollback: Optional[bool] = ..., - is_retried: Optional[bool] = ..., - rollback_policy: Optional[CloudInitiatedRollbackPolicy] = ..., - start_date_time: datetime, - update_property: UpdateInfo - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeploymentDeviceState(_Model): - device_id: str - device_state: Union[str, DeviceDeploymentState] - module_id: Optional[str] - moved_on_to_new_deployment: bool - retry_count: int - - @overload - def __init__( - self, - *, - device_id: str, - device_state: Union[str, DeviceDeploymentState], - module_id: Optional[str] = ..., - moved_on_to_new_deployment: bool, - retry_count: int - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "Active" - ACTIVE_WITH_SUBGROUP_FAILURES = "ActiveWithSubgroupFailures" - CANCELED = "Canceled" - FAILED = "Failed" - INACTIVE = "Inactive" - - - class azure.iot.deviceupdate.models.DeploymentStatus(_Model): - deployment_state: Union[str, DeploymentState] - error: Optional[Error] - group_id: str - subgroup_status: list[DeviceClassSubgroupDeploymentStatus] - - @overload - def __init__( - self, - *, - deployment_state: Union[str, DeploymentState], - error: Optional[Error] = ..., - group_id: str, - subgroup_status: list[DeviceClassSubgroupDeploymentStatus] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.Device(_Model): - deployment_status: Optional[Union[str, DeviceDeploymentState]] - device_class_id: str - device_id: str - group_id: Optional[str] - installed_update: Optional[UpdateInfo] - last_attempted_update: Optional[UpdateInfo] - last_deployment_id: Optional[str] - last_install_result: Optional[InstallResult] - module_id: Optional[str] - on_latest_update: bool - - @overload - def __init__( - self, - *, - deployment_status: Optional[Union[str, DeviceDeploymentState]] = ..., - device_class_id: str, - device_id: str, - group_id: Optional[str] = ..., - installed_update: Optional[UpdateInfo] = ..., - last_attempted_update: Optional[UpdateInfo] = ..., - last_deployment_id: Optional[str] = ..., - last_install_result: Optional[InstallResult] = ..., - module_id: Optional[str] = ..., - on_latest_update: bool - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceClass(_Model): - best_compatible_update: Optional[UpdateInfo] - device_class_id: str - device_class_properties: DeviceClassProperties - friendly_name: Optional[str] - - @overload - def __init__( - self, - *, - best_compatible_update: Optional[UpdateInfo] = ..., - device_class_id: str, - device_class_properties: DeviceClassProperties, - friendly_name: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceClassProperties(_Model): - compat_properties: dict[str, str] - contract_model: Optional[ContractModel] - - @overload - def __init__( - self, - *, - compat_properties: dict[str, str], - contract_model: Optional[ContractModel] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceClassSubgroup(_Model): - created_date_time: str - deployment_id: Optional[str] - device_class_id: str - device_count: Optional[int] - group_id: str - - @overload - def __init__( - self, - *, - created_date_time: str, - deployment_id: Optional[str] = ..., - device_class_id: str, - device_count: Optional[int] = ..., - group_id: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ACTIVE = "Active" - CANCELED = "Canceled" - FAILED = "Failed" - INACTIVE = "Inactive" - - - class azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus(_Model): - deployment_state: Union[str, DeviceClassSubgroupDeploymentState] - device_class_id: str - devices_canceled_count: Optional[int] - devices_completed_failed_count: Optional[int] - devices_completed_succeeded_count: Optional[int] - devices_in_progress_count: Optional[int] - error: Optional[Error] - group_id: str - total_devices: Optional[int] - - @overload - def __init__( - self, - *, - deployment_state: Union[str, DeviceClassSubgroupDeploymentState], - device_class_id: str, - devices_canceled_count: Optional[int] = ..., - devices_completed_failed_count: Optional[int] = ..., - devices_completed_succeeded_count: Optional[int] = ..., - devices_in_progress_count: Optional[int] = ..., - error: Optional[Error] = ..., - group_id: str, - total_devices: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices(_Model): - device_class_id: str - device_count: int - group_id: str - update_property: UpdateInfo - - @overload - def __init__( - self, - *, - device_class_id: str, - device_count: int, - group_id: str, - update_property: UpdateInfo - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceDeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - CANCELED = "Canceled" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - - - class azure.iot.deviceupdate.models.DeviceHealth(_Model): - device_id: str - digital_twin_model_id: Optional[str] - health_checks: list[HealthCheck] - module_id: Optional[str] - state: Union[str, DeviceHealthState] - - @overload - def __init__( - self, - *, - device_id: str, - digital_twin_model_id: Optional[str] = ..., - health_checks: list[HealthCheck], - module_id: Optional[str] = ..., - state: Union[str, DeviceHealthState] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceHealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HEALTHY = "healthy" - UNHEALTHY = "unhealthy" - - - class azure.iot.deviceupdate.models.DeviceOperation(_Model): - created_date_time: datetime - error: Optional[Error] - etag: Optional[str] - last_action_date_time: datetime - operation_id: str - status: Union[str, OperationStatus] - trace_id: Optional[str] - - @overload - def __init__( - self, - *, - created_date_time: datetime, - error: Optional[Error] = ..., - etag: Optional[str] = ..., - last_action_date_time: datetime, - operation_id: str, - status: Union[str, OperationStatus], - trace_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DeviceUpdateAgentId(_Model): - device_id: str - module_id: Optional[str] - - @overload - def __init__( - self, - *, - device_id: str, - module_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.DownloadSecurity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - HTTP = "http" - HTTPS = "https" - - - class azure.iot.deviceupdate.models.Error(_Model): - code: str - details: Optional[list[Error]] - innererror: Optional[InnerError] - message: str - occurred_date_time: Optional[datetime] - target: Optional[str] - - @overload - def __init__( - self, - *, - code: str, - details: Optional[list[Error]] = ..., - innererror: Optional[InnerError] = ..., - message: str, - occurred_date_time: Optional[datetime] = ..., - target: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.ErrorResponse(_Model): - error: Error - - @overload - def __init__( - self, - *, - error: Error - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.FileImportMetadata(_Model): - filename: str - url: str - - @overload - def __init__( - self, - *, - filename: str, - url: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.Group(_Model): - created_date_time: str - deployments: Optional[list[str]] - device_count: Optional[int] - group_id: str - group_type: Union[str, GroupType] - subgroups_with_new_updates_available_count: Optional[int] - subgroups_with_on_latest_update_count: Optional[int] - subgroups_with_updates_in_progress_count: Optional[int] - - @overload - def __init__( - self, - *, - created_date_time: str, - deployments: Optional[list[str]] = ..., - device_count: Optional[int] = ..., - group_id: str, - group_type: Union[str, GroupType], - subgroups_with_new_updates_available_count: Optional[int] = ..., - subgroups_with_on_latest_update_count: Optional[int] = ..., - subgroups_with_updates_in_progress_count: Optional[int] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.GroupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - DEFAULT_NO_TAG = "DefaultNoTag" - IO_T_HUB_TAG = "IoTHubTag" - - - class azure.iot.deviceupdate.models.HealthCheck(_Model): - name: Optional[str] - result: Optional[Union[str, HealthCheckResult]] - - @overload - def __init__( - self, - *, - name: Optional[str] = ..., - result: Optional[Union[str, HealthCheckResult]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.HealthCheckResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): - SUCCESS = "success" - USER_ERROR = "userError" - - - class azure.iot.deviceupdate.models.ImportManifestMetadata(_Model): - hashes: dict[str, str] - size_in_bytes: int - url: str - - @overload - def __init__( - self, - *, - hashes: dict[str, str], - size_in_bytes: int, - url: str - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.ImportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - ALL = "All" - DEVICES = "Devices" - MODULES = "Modules" - - - class azure.iot.deviceupdate.models.ImportUpdateInputItem(_Model): - files: Optional[list[FileImportMetadata]] - friendly_name: Optional[str] - import_manifest: ImportManifestMetadata - - @overload - def __init__( - self, - *, - files: Optional[list[FileImportMetadata]] = ..., - friendly_name: Optional[str] = ..., - import_manifest: ImportManifestMetadata - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.InnerError(_Model): - code: str - error_detail: Optional[str] - inner_error: Optional[InnerError] - message: Optional[str] - - @overload - def __init__( - self, - *, - code: str, - error_detail: Optional[str] = ..., - inner_error: Optional[InnerError] = ..., - message: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.InstallResult(_Model): - extended_result_code: int - result_code: int - result_details: Optional[str] - step_results: Optional[list[StepResult]] - - @overload - def __init__( - self, - *, - extended_result_code: int, - result_code: int, - result_details: Optional[str] = ..., - step_results: Optional[list[StepResult]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.Instructions(_Model): - steps: list[Step] - - @overload - def __init__( - self, - *, - steps: list[Step] - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.LogCollection(_Model): - created_date_time: Optional[str] - description: Optional[str] - device_list: list[DeviceUpdateAgentId] - last_action_date_time: Optional[str] - log_collection_id: Optional[str] - status: Optional[Union[str, OperationStatus]] - - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - device_list: list[DeviceUpdateAgentId], - log_collection_id: Optional[str] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus(_Model): - created_date_time: Optional[str] - description: Optional[str] - device_status: Optional[list[LogCollectionOperationDeviceStatus]] - last_action_date_time: Optional[str] - log_collection_id: Optional[str] - status: Optional[Union[str, OperationStatus]] - - @overload - def __init__( - self, - *, - created_date_time: Optional[str] = ..., - description: Optional[str] = ..., - device_status: Optional[list[LogCollectionOperationDeviceStatus]] = ..., - last_action_date_time: Optional[str] = ..., - log_collection_id: Optional[str] = ..., - status: Optional[Union[str, OperationStatus]] = ... - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.LogCollectionOperationDeviceStatus(_Model): - device_id: str - extended_result_code: Optional[str] - log_location: Optional[str] - module_id: Optional[str] - result_code: Optional[str] - status: Union[str, OperationStatus] - - @overload - def __init__( - self, - *, - device_id: str, - extended_result_code: Optional[str] = ..., - log_location: Optional[str] = ..., - module_id: Optional[str] = ..., - result_code: Optional[str] = ..., - status: Union[str, OperationStatus] + async def delete_group( + self, + group_id: str, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def get_group_update_compliance( + self, + group_id: str, + **kwargs: Any + ) -> JSON: ... + @distributed_trace + def list_best_updates_for_group( + self, + group_id: str, + *, + filter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterable[JSON]: ... - class azure.iot.deviceupdate.models.OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - FAILED = "Failed" - NOT_STARTED = "NotStarted" - RUNNING = "Running" - SUCCEEDED = "Succeeded" + @distributed_trace + def list_deployments_for_group( + self, + group_id: str, + *, + orderby: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterable[JSON]: ... + @distributed_trace_async + async def get_deployment( + self, + group_id: str, + deployment_id: str, + **kwargs: Any + ) -> JSON: ... - class azure.iot.deviceupdate.models.PatchBody(_Model): - friendly_name: str + @overload + async def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: JSON, + *, + content_type: str = 'application/json', + **kwargs: Any + ) -> JSON: ... @overload - def __init__( - self, - *, - friendly_name: str + async def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: IO, + *, + content_type: str = 'application/json', + **kwargs: Any + ) -> JSON: ... + + @distributed_trace_async + async def delete_deployment( + self, + group_id: str, + deployment_id: str, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def get_deployment_status( + self, + group_id: str, + deployment_id: str, + **kwargs: Any + ) -> JSON: ... + @distributed_trace_async + async def list_device_class_subgroups_for_group( + self, + group_id: str, + *, + filter: Optional[str] = ..., + **kwargs: Any + ) -> JSON: ... - class azure.iot.deviceupdate.models.Step(_Model): - description: Optional[str] - files: Optional[list[str]] - handler: Optional[str] - handler_properties: Optional[dict[str, Any]] - type: Optional[Union[str, StepType]] - update_id: Optional[UpdateId] + @distributed_trace_async + async def get_device_class_subgroup_details( + self, + group_id: str, + device_class_id: str, + **kwargs: Any + ) -> JSON: ... - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - files: Optional[list[str]] = ..., - handler: Optional[str] = ..., - handler_properties: Optional[dict[str, Any]] = ..., - type: Optional[Union[str, StepType]] = ..., - update_id: Optional[UpdateId] = ... + @distributed_trace_async + async def delete_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - + @distributed_trace_async + async def get_device_class_subgroup_update_compliance( + self, + group_id: str, + device_class_id: str, + **kwargs: Any + ) -> JSON: ... - class azure.iot.deviceupdate.models.StepResult(_Model): - description: Optional[str] - extended_result_code: int - result_code: int - result_details: Optional[str] - update_property: Optional[UpdateInfo] + @distributed_trace_async + async def list_best_updates_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + **kwargs: Any + ) -> JSON: ... - @overload - def __init__( - self, - *, - description: Optional[str] = ..., - extended_result_code: int, - result_code: int, - result_details: Optional[str] = ..., - update_property: Optional[UpdateInfo] = ... - ) -> None: ... + @distributed_trace + def list_deployments_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + *, + orderby: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterable[JSON]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.StepType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - INLINE = "inline" - REFERENCE = "reference" - - - class azure.iot.deviceupdate.models.Update(_Model): - compatibility: list[Compatibility] - created_date_time: datetime - description: Optional[str] - etag: Optional[str] - friendly_name: Optional[str] - imported_date_time: datetime - installed_criteria: Optional[str] - instructions: Optional[Instructions] - is_deployable: Optional[bool] - manifest_version: str - referenced_by: Optional[list[UpdateId]] - scan_result: Optional[str] - update_id: UpdateId - update_type: Optional[str] + @distributed_trace_async + async def get_deployment_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + **kwargs: Any + ) -> JSON: ... - @overload - def __init__( - self, - *, - compatibility: list[Compatibility], - created_date_time: datetime, - description: Optional[str] = ..., - etag: Optional[str] = ..., - friendly_name: Optional[str] = ..., - imported_date_time: datetime, - installed_criteria: Optional[str] = ..., - instructions: Optional[Instructions] = ..., - is_deployable: Optional[bool] = ..., - manifest_version: str, - referenced_by: Optional[list[UpdateId]] = ..., - scan_result: Optional[str] = ..., - update_id: UpdateId, - update_type: Optional[str] = ... + @distributed_trace_async + async def delete_device_class_subgroup_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + **kwargs: Any ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def stop_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + **kwargs: Any + ) -> JSON: ... + + @distributed_trace_async + async def retry_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + **kwargs: Any + ) -> JSON: ... + @distributed_trace_async + async def get_device_class_subgroup_deployment_status( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + **kwargs: Any + ) -> JSON: ... - class azure.iot.deviceupdate.models.UpdateCompliance(_Model): - new_updates_available_device_count: int - on_latest_update_device_count: int - total_device_count: int - updates_in_progress_device_count: int + @distributed_trace + def list_devices_for_device_class_subgroup_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + *, + filter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterable[JSON]: ... - @overload - def __init__( - self, - *, - new_updates_available_device_count: int, - on_latest_update_device_count: int, - total_device_count: int, - updates_in_progress_device_count: int - ) -> None: ... + @distributed_trace_async + async def get_operation( + self, + operation_id: str, + *, + if_none_match: Optional[str] = ..., + **kwargs: Any + ) -> Optional[JSON]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.UpdateFile(UpdateFileBase): - download_handler: Optional[UpdateFileDownloadHandler] - etag: Optional[str] - file_id: str - file_name: str - hashes: dict[str, str] - mime_type: str - properties: dict[str, str] - related_files: Optional[list[UpdateFileBase]] - scan_details: str - scan_result: str - size_in_bytes: int + @distributed_trace + def list_operations( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncIterable[JSON]: ... @overload - def __init__( - self, - *, - download_handler: Optional[UpdateFileDownloadHandler] = ..., - etag: Optional[str] = ..., - file_id: str, - file_name: str, - hashes: dict[str, str], - mime_type: Optional[str] = ..., - properties: Optional[dict[str, str]] = ..., - related_files: Optional[list[UpdateFileBase]] = ..., - scan_details: Optional[str] = ..., - scan_result: Optional[str] = ..., - size_in_bytes: int - ) -> None: ... + async def collect_logs( + self, + operation_id: str, + log_collection_request: JSON, + *, + content_type: str = 'application/json', + **kwargs: Any + ) -> JSON: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + async def collect_logs( + self, + operation_id: str, + log_collection_request: IO, + *, + content_type: str = 'application/json', + **kwargs: Any + ) -> JSON: ... + @distributed_trace_async + async def get_log_collection_operation( + self, + operation_id: str, + **kwargs: Any + ) -> JSON: ... - class azure.iot.deviceupdate.models.UpdateFileBase(_Model): - file_name: str - hashes: dict[str, str] - mime_type: Optional[str] - properties: Optional[dict[str, str]] - scan_details: Optional[str] - scan_result: Optional[str] - size_in_bytes: int + @distributed_trace + def list_log_collection_operations( + self, + **kwargs: Any + ) -> AsyncIterable[JSON]: ... - @overload - def __init__( - self, - *, - file_name: str, - hashes: dict[str, str], - mime_type: Optional[str] = ..., - properties: Optional[dict[str, str]] = ..., - scan_details: Optional[str] = ..., - scan_result: Optional[str] = ..., - size_in_bytes: int - ) -> None: ... + @distributed_trace_async + async def get_log_collection_operation_detailed_status( + self, + operation_id: str, + **kwargs: Any + ) -> JSON: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace_async + async def list_device_health( + self, + *, + filter: str, + **kwargs: Any + ) -> JSON: ... - class azure.iot.deviceupdate.models.UpdateFileDownloadHandler(_Model): - id: str + class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations: - @overload def __init__( - self, - *, - id: str + self, + *args, + **kwargs ) -> None: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... - - - class azure.iot.deviceupdate.models.UpdateId(_Model): - name: str - provider: str - version: str + @distributed_trace + def list_updates( + self, + *, + search: Optional[str] = ..., + filter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterable[JSON]: ... @overload - def __init__( - self, - *, - name: str, - provider: str, - version: str - ) -> None: ... + async def begin_import_update( + self, + update_to_import: list[JSON], + *, + content_type: str = 'application/json', + **kwargs: Any + ) -> AsyncLROPoller[None]: ... @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + async def begin_import_update( + self, + update_to_import: IO, + *, + content_type: str = 'application/json', + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + @distributed_trace_async + async def get_update( + self, + provider: str, + name: str, + version: str, + *, + if_none_match: Optional[str] = ..., + **kwargs: Any + ) -> Optional[JSON]: ... - class azure.iot.deviceupdate.models.UpdateInfo(_Model): - description: Optional[str] - friendly_name: Optional[str] - update_id: UpdateId + @distributed_trace_async + async def begin_delete_update( + self, + provider: str, + name: str, + version: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... - @overload - def __init__( - self, - *, - update_id: UpdateId - ) -> None: ... + @distributed_trace + def list_providers( + self, + **kwargs: Any + ) -> AsyncIterable[str]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def list_names( + self, + provider: str, + **kwargs: Any + ) -> AsyncIterable[str]: ... + @distributed_trace + def list_versions( + self, + provider: str, + name: str, + *, + filter: Optional[str] = ..., + **kwargs: Any + ) -> AsyncIterable[str]: ... - class azure.iot.deviceupdate.models.UpdateOperation(_Model): - created_date_time: datetime - error: Optional[Error] - etag: Optional[str] - last_action_date_time: datetime - operation_id: str - resource_location: Optional[str] - status: Union[str, OperationStatus] - trace_id: Optional[str] - update_property: Optional[UpdateInfo] + @distributed_trace + def list_files( + self, + provider: str, + name: str, + version: str, + **kwargs: Any + ) -> AsyncIterable[str]: ... - @overload - def __init__( - self, - *, - created_date_time: datetime, - error: Optional[Error] = ..., - etag: Optional[str] = ..., - last_action_date_time: datetime, - operation_id: str, - resource_location: Optional[str] = ..., - status: Union[str, OperationStatus], - trace_id: Optional[str] = ..., - update_property: Optional[UpdateInfo] = ... - ) -> None: ... + @distributed_trace_async + async def get_file( + self, + provider: str, + name: str, + version: str, + file_id: str, + *, + if_none_match: Optional[str] = ..., + **kwargs: Any + ) -> Optional[JSON]: ... - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: ... + @distributed_trace + def list_operations( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncIterable[JSON]: ... + + @distributed_trace_async + async def get_operation( + self, + operation_id: str, + *, + if_none_match: Optional[str] = ..., + **kwargs: Any + ) -> Optional[JSON]: ... namespace azure.iot.deviceupdate.operations @@ -1479,620 +530,477 @@ namespace azure.iot.deviceupdate.operations class azure.iot.deviceupdate.operations.DeviceManagementOperations: def __init__( - self, - *args, + self, + *args, **kwargs ) -> None: ... @distributed_trace - def begin_import_devices( - self, - import_type: Union[str, ImportType], + def list_device_classes( + self, **kwargs: Any - ) -> LROPoller[None]: ... + ) -> Iterable[JSON]: ... - @overload - def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: Deployment, - *, - content_type: str = "application/json", + @distributed_trace + def get_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> Deployment: ... + ) -> JSON: ... @overload - def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: Deployment, - *, - content_type: str = "application/json", + def update_device_class( + self, + device_class_id: str, + device_class_patch: JSON, + *, + content_type: str = 'application/merge-patch+json', **kwargs: Any - ) -> Deployment: ... + ) -> JSON: ... @overload - def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: IO[bytes], - *, - content_type: str = "application/json", + def update_device_class( + self, + device_class_id: str, + device_class_patch: IO, + *, + content_type: str = 'application/merge-patch+json', **kwargs: Any - ) -> Deployment: ... + ) -> JSON: ... @distributed_trace - def delete_deployment( - self, - group_id: str, - deployment_id: str, + def delete_device_class( + self, + device_class_id: str, **kwargs: Any ) -> None: ... @distributed_trace - def delete_deployment_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_installable_updates_for_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> None: ... + ) -> Iterable[JSON]: ... @distributed_trace - def delete_device_class( - self, - device_class_id: str, + def list_devices( + self, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> None: ... + ) -> Iterable[JSON]: ... @distributed_trace - def delete_device_class_subgroup( - self, - group_id: str, - device_class_id: str, + def begin_import_devices( + self, + import_type: str, **kwargs: Any - ) -> None: ... + ) -> LROPoller[None]: ... @distributed_trace - def delete_group( - self, - group_id: str, + def get_device( + self, + device_id: str, **kwargs: Any - ) -> None: ... + ) -> JSON: ... @distributed_trace - def get_best_updates_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, + def get_device_module( + self, + device_id: str, + module_id: str, **kwargs: Any - ) -> DeviceClassSubgroupUpdatableDevices: ... + ) -> JSON: ... @distributed_trace - def get_deployment( - self, - group_id: str, - deployment_id: str, + def get_update_compliance( + self, **kwargs: Any - ) -> Deployment: ... + ) -> JSON: ... @distributed_trace - def get_deployment_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_groups( + self, + *, + orderby: Optional[str] = ..., **kwargs: Any - ) -> Deployment: ... + ) -> Iterable[JSON]: ... @distributed_trace - def get_deployment_status( - self, - group_id: str, - deployment_id: str, + def get_group( + self, + group_id: str, **kwargs: Any - ) -> DeploymentStatus: ... + ) -> JSON: ... @distributed_trace - def get_device( - self, - device_id: str, + def delete_group( + self, + group_id: str, **kwargs: Any - ) -> Device: ... + ) -> None: ... @distributed_trace - def get_device_class( - self, - device_class_id: str, + def get_group_update_compliance( + self, + group_id: str, **kwargs: Any - ) -> DeviceClass: ... + ) -> JSON: ... @distributed_trace - def get_device_class_subgroup( - self, - group_id: str, - device_class_id: str, + def list_best_updates_for_group( + self, + group_id: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> DeviceClassSubgroup: ... + ) -> Iterable[JSON]: ... @distributed_trace - def get_device_class_subgroup_deployment_status( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_deployments_for_group( + self, + group_id: str, + *, + orderby: Optional[str] = ..., **kwargs: Any - ) -> DeviceClassSubgroupDeploymentStatus: ... + ) -> Iterable[JSON]: ... @distributed_trace - def get_device_class_subgroup_update_compliance( - self, - group_id: str, - device_class_id: str, + def get_deployment( + self, + group_id: str, + deployment_id: str, **kwargs: Any - ) -> UpdateCompliance: ... + ) -> JSON: ... - @distributed_trace - def get_device_module( - self, - device_id: str, - module_id: str, + @overload + def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: JSON, + *, + content_type: str = 'application/json', **kwargs: Any - ) -> Device: ... + ) -> JSON: ... - @distributed_trace - def get_group( - self, - group_id: str, + @overload + def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: IO, + *, + content_type: str = 'application/json', **kwargs: Any - ) -> Group: ... + ) -> JSON: ... @distributed_trace - def get_log_collection( - self, - log_collection_id: str, + def delete_deployment( + self, + group_id: str, + deployment_id: str, **kwargs: Any - ) -> LogCollection: ... + ) -> None: ... @distributed_trace - def get_log_collection_detailed_status( - self, - log_collection_id: str, + def get_deployment_status( + self, + group_id: str, + deployment_id: str, **kwargs: Any - ) -> LogCollectionOperationDetailedStatus: ... + ) -> JSON: ... @distributed_trace - def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + def list_device_class_subgroups_for_group( + self, + group_id: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> DeviceOperation: ... - - @distributed_trace - def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... + ) -> JSON: ... @distributed_trace - def get_update_compliance_for_group( - self, - group_id: str, + def get_device_class_subgroup_details( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> UpdateCompliance: ... + ) -> JSON: ... @distributed_trace - def list_best_updates_for_group( - self, - group_id: str, + def delete_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> ItemPaged[DeviceClassSubgroupUpdatableDevices]: ... + ) -> None: ... @distributed_trace - def list_deployments_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - *, - order_by: Optional[str] = ..., + def get_device_class_subgroup_update_compliance( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> ItemPaged[Deployment]: ... + ) -> JSON: ... @distributed_trace - def list_deployments_for_group( - self, - group_id: str, - *, - order_by: Optional[str] = ..., + def list_best_updates_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> ItemPaged[Deployment]: ... + ) -> JSON: ... @distributed_trace - def list_device_class_subgroups_for_group( - self, - group_id: str, - *, - filter: Optional[str] = ..., + def list_deployments_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + *, + orderby: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[DeviceClassSubgroup]: ... + ) -> Iterable[JSON]: ... @distributed_trace - def list_device_classes( - self, - *, - filter: Optional[str] = ..., + def get_deployment_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> ItemPaged[DeviceClass]: ... + ) -> JSON: ... @distributed_trace - def list_device_states_for_device_class_subgroup_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, - *, - filter: Optional[str] = ..., + def delete_device_class_subgroup_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> ItemPaged[DeploymentDeviceState]: ... + ) -> None: ... @distributed_trace - def list_devices( - self, - *, - filter: Optional[str] = ..., + def stop_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> ItemPaged[Device]: ... + ) -> JSON: ... @distributed_trace - def list_groups( - self, - *, - order_by: Optional[str] = ..., + def retry_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> ItemPaged[Group]: ... + ) -> JSON: ... @distributed_trace - def list_health_of_devices( - self, - *, - filter: str, + def get_device_class_subgroup_deployment_status( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> ItemPaged[DeviceHealth]: ... + ) -> JSON: ... @distributed_trace - def list_installable_updates_for_device_class( - self, - device_class_id: str, + def list_devices_for_device_class_subgroup_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[UpdateInfo]: ... - - @distributed_trace - def list_log_collections(self, **kwargs: Any) -> ItemPaged[LogCollection]: ... + ) -> Iterable[JSON]: ... @distributed_trace - def list_operation_statuses( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., + def get_operation( + self, + operation_id: str, + *, + if_none_match: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[DeviceOperation]: ... + ) -> Optional[JSON]: ... @distributed_trace - def retry_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_operations( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., **kwargs: Any - ) -> Deployment: ... + ) -> Iterable[JSON]: ... @overload - def start_log_collection( - self, - log_collection_id: str, - log_collection: LogCollection, - *, - content_type: str = "application/json", + def collect_logs( + self, + operation_id: str, + log_collection_request: JSON, + *, + content_type: str = 'application/json', **kwargs: Any - ) -> LogCollection: ... + ) -> JSON: ... @overload - def start_log_collection( - self, - log_collection_id: str, - log_collection: LogCollection, - *, - content_type: str = "application/json", + def collect_logs( + self, + operation_id: str, + log_collection_request: IO, + *, + content_type: str = 'application/json', **kwargs: Any - ) -> LogCollection: ... - - @overload - def start_log_collection( - self, - log_collection_id: str, - log_collection: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LogCollection: ... + ) -> JSON: ... @distributed_trace - def stop_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def get_log_collection_operation( + self, + operation_id: str, **kwargs: Any - ) -> Deployment: ... + ) -> JSON: ... - @overload - def update_device_class( - self, - device_class_id: str, - device_class_patch: PatchBody, - *, - content_type: str = "application/merge-patch+json", + @distributed_trace + def list_log_collection_operations( + self, **kwargs: Any - ) -> DeviceClass: ... + ) -> Iterable[JSON]: ... - @overload - def update_device_class( - self, - device_class_id: str, - device_class_patch: PatchBody, - *, - content_type: str = "application/merge-patch+json", + @distributed_trace + def get_log_collection_operation_detailed_status( + self, + operation_id: str, **kwargs: Any - ) -> DeviceClass: ... + ) -> JSON: ... - @overload - def update_device_class( - self, - device_class_id: str, - device_class_patch: IO[bytes], - *, - content_type: str = "application/merge-patch+json", + @distributed_trace + def list_device_health( + self, + *, + filter: str, **kwargs: Any - ) -> DeviceClass: ... + ) -> JSON: ... class azure.iot.deviceupdate.operations.DeviceUpdateOperations: def __init__( - self, - *args, + self, + *args, **kwargs ) -> None: ... @distributed_trace - def begin_delete_update( - self, - provider: str, - name: str, - version: str, + def list_updates( + self, + *, + search: Optional[str] = ..., + filter: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[None]: ... + ) -> Iterable[JSON]: ... @overload def begin_import_update( - self, - update_to_import: list[ImportUpdateInputItem], - *, - content_type: str = "application/json", + self, + update_to_import: list[JSON], + *, + content_type: str = 'application/json', **kwargs: Any ) -> LROPoller[None]: ... @overload def begin_import_update( - self, - update_to_import: list[ImportUpdateInputItem], - *, - content_type: str = "application/json", + self, + update_to_import: IO, + *, + content_type: str = 'application/json', **kwargs: Any ) -> LROPoller[None]: ... - @overload - def begin_import_update( - self, - update_to_import: IO[bytes], - *, - content_type: str = "application/json", + @distributed_trace + def get_update( + self, + provider: str, + name: str, + version: str, + *, + if_none_match: Optional[str] = ..., **kwargs: Any - ) -> LROPoller[None]: ... + ) -> Optional[JSON]: ... @distributed_trace - def get_file( - self, - provider: str, - name: str, - version: str, - file_id: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + def begin_delete_update( + self, + provider: str, + name: str, + version: str, **kwargs: Any - ) -> UpdateFile: ... + ) -> LROPoller[None]: ... @distributed_trace - def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + def list_providers( + self, **kwargs: Any - ) -> UpdateOperation: ... + ) -> Iterable[str]: ... @distributed_trace - def get_update( - self, - provider: str, - name: str, - version: str, - *, - etag: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., + def list_names( + self, + provider: str, **kwargs: Any - ) -> Update: ... + ) -> Iterable[str]: ... @distributed_trace - def list_files( - self, - provider: str, - name: str, - version: str, + def list_versions( + self, + provider: str, + name: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[str]: ... + ) -> Iterable[str]: ... @distributed_trace - def list_names( - self, - provider: str, + def list_files( + self, + provider: str, + name: str, + version: str, **kwargs: Any - ) -> ItemPaged[str]: ... + ) -> Iterable[str]: ... @distributed_trace - def list_operation_statuses( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., + def get_file( + self, + provider: str, + name: str, + version: str, + file_id: str, + *, + if_none_match: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[UpdateOperation]: ... + ) -> Optional[JSON]: ... @distributed_trace - def list_providers(self, **kwargs: Any) -> ItemPaged[str]: ... + def list_operations( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> Iterable[JSON]: ... @distributed_trace - def list_updates( - self, - *, - filter: Optional[str] = ..., - search: Optional[str] = ..., + def get_operation( + self, + operation_id: str, + *, + if_none_match: Optional[str] = ..., **kwargs: Any - ) -> ItemPaged[Update]: ... + ) -> Optional[JSON]: ... - @distributed_trace - def list_versions( - self, - provider: str, - name: str, - *, - filter: Optional[str] = ..., - **kwargs: Any - ) -> ItemPaged[str]: ... - - -namespace azure.iot.deviceupdate.types - - class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicy(TypedDict, total=False): - key "failure": Required[CloudInitiatedRollbackPolicyFailure] - key "update": Required[UpdateInfo] - failure: CloudInitiatedRollbackPolicyFailure - update_property: UpdateInfo - - - class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): - key "devicesFailedCount": Required[int] - key "devicesFailedPercentage": Required[int] - devices_failed_count: int - devices_failed_percentage: int - - - class azure.iot.deviceupdate.types.Deployment(TypedDict, total=False): - key "deploymentId": Required[str] - key "downloadSecurity": Union[str, DownloadSecurity] - key "groupId": Required[str] - key "isCanceled": bool - key "isCloudInitiatedRollback": bool - key "isRetried": bool - key "rollbackPolicy": ForwardRef('CloudInitiatedRollbackPolicy', module='types') - key "startDateTime": Required[str] - key "update": Required[UpdateInfo] - deployment_id: str - deviceClassSubgroups: list[str] - device_class_subgroups: list[str] - download_security: Union[str, DownloadSecurity] - group_id: str - is_canceled: bool - is_cloud_initiated_rollback: bool - is_retried: bool - rollback_policy: CloudInitiatedRollbackPolicy - start_date_time: str - update_property: UpdateInfo - - - class azure.iot.deviceupdate.types.DeviceUpdateAgentId(TypedDict, total=False): - key "deviceId": Required[str] - key "moduleId": str - device_id: str - module_id: str - - - class azure.iot.deviceupdate.types.FileImportMetadata(TypedDict, total=False): - key "filename": Required[str] - key "url": Required[str] - filename: str - url: str - - - class azure.iot.deviceupdate.types.ImportManifestMetadata(TypedDict, total=False): - key "hashes": Required[dict[str, str]] - key "sizeInBytes": Required[int] - key "url": Required[str] - hashes: dict[str, str] - size_in_bytes: int - url: str - - - class azure.iot.deviceupdate.types.ImportUpdateInputItem(TypedDict, total=False): - key "friendlyName": str - key "importManifest": Required[ImportManifestMetadata] - files: list[FileImportMetadata] - friendly_name: str - import_manifest: ImportManifestMetadata - - - class azure.iot.deviceupdate.types.LogCollection(TypedDict, total=False): - key "createdDateTime": str - key "description": str - key "deviceList": Required[list[DeviceUpdateAgentId]] - key "lastActionDateTime": str - key "operationId": str - key "status": Union[str, OperationStatus] - created_date_time: str - description: str - device_list: list[DeviceUpdateAgentId] - last_action_date_time: str - log_collection_id: str - status: Union[str, OperationStatus] - - - class azure.iot.deviceupdate.types.PatchBody(TypedDict, total=False): - key "friendlyName": Required[str] - friendly_name: str - - - class azure.iot.deviceupdate.types.UpdateId(TypedDict, total=False): - key "name": Required[str] - key "provider": Required[str] - key "version": Required[str] - name: str - provider: str - version: str - - - class azure.iot.deviceupdate.types.UpdateInfo(TypedDict, total=False): - key "description": str - key "friendlyName": str - key "updateId": Required[UpdateId] - description: str - friendly_name: str - update_id: UpdateId - - -``` \ No newline at end of file + +``` diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml index a4a121bbf943..555c54025812 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: e6da310dba4ea5263163ad432f276371b3025fcca87680847e130581a6157980 +apiMdSha256: 6d64fd40512f73229386ae3dbf5471b9411b77f6bb7acd56c6a50829ec725697 parserVersion: 0.3.30 pythonVersion: 3.13.14 diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json index d5edd1a08519..fd6ab75616b2 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json +++ b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json @@ -1,56 +1,6 @@ { "CrossLanguagePackageId": "DeviceUpdateClient", "CrossLanguageDefinitionId": { - "azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy": "DeviceUpdateClient.CloudInitiatedRollbackPolicy", - "azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure": "DeviceUpdateClient.CloudInitiatedRollbackPolicyFailure", - "azure.iot.deviceupdate.models.Compatibility": "DeviceUpdateClient.Compatibility", - "azure.iot.deviceupdate.models.ContractModel": "DeviceUpdateClient.ContractModel", - "azure.iot.deviceupdate.models.Deployment": "DeviceUpdateClient.Deployment", - "azure.iot.deviceupdate.models.DeploymentDeviceState": "DeviceUpdateClient.DeploymentDeviceState", - "azure.iot.deviceupdate.models.DeploymentStatus": "DeviceUpdateClient.DeploymentStatus", - "azure.iot.deviceupdate.models.Device": "DeviceUpdateClient.Device", - "azure.iot.deviceupdate.models.DeviceClass": "DeviceUpdateClient.DeviceClass", - "azure.iot.deviceupdate.models.DeviceClassProperties": "DeviceUpdateClient.DeviceClassProperties", - "azure.iot.deviceupdate.models.DeviceClassSubgroup": "DeviceUpdateClient.DeviceClassSubgroup", - "azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus": "DeviceUpdateClient.DeviceClassSubgroupDeploymentStatus", - "azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices": "DeviceUpdateClient.DeviceClassSubgroupUpdatableDevices", - "azure.iot.deviceupdate.models.DeviceHealth": "DeviceUpdateClient.DeviceHealth", - "azure.iot.deviceupdate.models.DeviceOperation": "DeviceUpdateClient.DeviceOperation", - "azure.iot.deviceupdate.models.DeviceUpdateAgentId": "DeviceUpdateClient.DeviceUpdateAgentId", - "azure.iot.deviceupdate.models.Error": "DeviceUpdateClient.Error", - "azure.iot.deviceupdate.models.ErrorResponse": "DeviceUpdateClient.ErrorResponse", - "azure.iot.deviceupdate.models.FileImportMetadata": "DeviceUpdateClient.FileImportMetadata", - "azure.iot.deviceupdate.models.Group": "DeviceUpdateClient.Group", - "azure.iot.deviceupdate.models.HealthCheck": "DeviceUpdateClient.HealthCheck", - "azure.iot.deviceupdate.models.ImportManifestMetadata": "DeviceUpdateClient.ImportManifestMetadata", - "azure.iot.deviceupdate.models.ImportUpdateInputItem": "DeviceUpdateClient.ImportUpdateInputItem", - "azure.iot.deviceupdate.models.InnerError": "DeviceUpdateClient.InnerError", - "azure.iot.deviceupdate.models.InstallResult": "DeviceUpdateClient.InstallResult", - "azure.iot.deviceupdate.models.Instructions": "DeviceUpdateClient.Instructions", - "azure.iot.deviceupdate.models.LogCollection": "DeviceUpdateClient.LogCollection", - "azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus": "DeviceUpdateClient.LogCollectionOperationDetailedStatus", - "azure.iot.deviceupdate.models.LogCollectionOperationDeviceStatus": "DeviceUpdateClient.LogCollectionOperationDeviceStatus", - "azure.iot.deviceupdate.models.PatchBody": "DeviceUpdateClient.PatchBody", - "azure.iot.deviceupdate.models.Step": "DeviceUpdateClient.Step", - "azure.iot.deviceupdate.models.StepResult": "DeviceUpdateClient.StepResult", - "azure.iot.deviceupdate.models.Update": "DeviceUpdateClient.Update", - "azure.iot.deviceupdate.models.UpdateCompliance": "DeviceUpdateClient.UpdateCompliance", - "azure.iot.deviceupdate.models.UpdateFileBase": "DeviceUpdateClient.UpdateFileBase", - "azure.iot.deviceupdate.models.UpdateFile": "DeviceUpdateClient.UpdateFile", - "azure.iot.deviceupdate.models.UpdateFileDownloadHandler": "DeviceUpdateClient.UpdateFileDownloadHandler", - "azure.iot.deviceupdate.models.UpdateId": "DeviceUpdateClient.UpdateId", - "azure.iot.deviceupdate.models.UpdateInfo": "DeviceUpdateClient.UpdateInfo", - "azure.iot.deviceupdate.models.UpdateOperation": "DeviceUpdateClient.UpdateOperation", - "azure.iot.deviceupdate.models.StepType": "DeviceUpdateClient.StepType", - "azure.iot.deviceupdate.models.OperationStatus": "DeviceUpdateClient.OperationStatus", - "azure.iot.deviceupdate.models.DeviceDeploymentState": "DeviceUpdateClient.DeviceDeploymentState", - "azure.iot.deviceupdate.models.ImportType": "DeviceUpdateClient.ImportType", - "azure.iot.deviceupdate.models.GroupType": "DeviceUpdateClient.GroupType", - "azure.iot.deviceupdate.models.DownloadSecurity": "DeviceUpdateClient.DownloadSecurity", - "azure.iot.deviceupdate.models.DeploymentState": "DeviceUpdateClient.DeploymentState", - "azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState": "DeviceUpdateClient.DeviceClassSubgroupDeploymentState", - "azure.iot.deviceupdate.models.DeviceHealthState": "DeviceUpdateClient.DeviceHealthState", - "azure.iot.deviceupdate.models.HealthCheckResult": "DeviceUpdateClient.HealthCheckResult", "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", @@ -69,10 +19,10 @@ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", @@ -99,8 +49,8 @@ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", @@ -115,42 +65,42 @@ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_details": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_details": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices" + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.collect_logs": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.collect_logs": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collection_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collection_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_operation_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_operation_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_health": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_health": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices" }, "CrossLanguageVersion": "c1a73ac75a65" -} \ No newline at end of file +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py index 87676c65a8f0..ab943728ce93 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any __all__: list[str] = [] # Add all objects you want publicly available to users at this package level @@ -19,3 +20,11 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from ._client import DeviceUpdateClient + + generated_init = DeviceUpdateClient.__init__ + + def legacy_init(self, endpoint: str, instance_id: str, credential: Any, **kwargs: Any) -> None: + generated_init(self, endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) + + DeviceUpdateClient.__init__ = legacy_init diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py index 87676c65a8f0..ab943728ce93 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any __all__: list[str] = [] # Add all objects you want publicly available to users at this package level @@ -19,3 +20,11 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from ._client import DeviceUpdateClient + + generated_init = DeviceUpdateClient.__init__ + + def legacy_init(self, endpoint: str, instance_id: str, credential: Any, **kwargs: Any) -> None: + generated_init(self, endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) + + DeviceUpdateClient.__init__ = legacy_init diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py index 87676c65a8f0..d1fd91da9223 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py @@ -7,11 +7,41 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any, Optional, get_args +from azure.core import MatchConditions +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) + +from ..._utils.model_base import _is_model __all__: list[str] = [] # Add all objects you want publicly available to users at this package level +def _contains_model(deserializer: Any) -> bool: + if _is_model(deserializer): + return True + return any(_contains_model(argument) for argument in get_args(deserializer)) + + +def _conditional_kwargs(if_none_match: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: + if if_none_match is not None: + kwargs["etag"] = if_none_match + kwargs["match_condition"] = MatchConditions.IfModified + return kwargs + + +def _rename_orderby(orderby: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: + kwargs["order_by"] = orderby + return kwargs + + def patch_sdk(): """Do not remove from this file. @@ -19,3 +49,170 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from . import _operations + + update_operations = _operations.DeviceUpdateOperations + management_operations = _operations.DeviceManagementOperations + + generated_deserialize = getattr(_operations, "_deserialize") + + def raw_model_deserialize(deserializer, value, *args, **kwargs): + if _contains_model(deserializer): + return value + return generated_deserialize(deserializer, value, *args, **kwargs) + + setattr(_operations, "_deserialize", raw_model_deserialize) + + get_update = update_operations.get_update + get_file = update_operations.get_file + get_update_operation = update_operations.get_operation_status + list_update_operations = update_operations.list_operation_statuses + + async def legacy_get_update(self, provider, name, version, *, if_none_match=None, **kwargs): + return await get_update(self, provider, name, version, **_conditional_kwargs(if_none_match, kwargs)) + + async def legacy_get_file(self, provider, name, version, file_id, *, if_none_match=None, **kwargs): + return await get_file(self, provider, name, version, file_id, **_conditional_kwargs(if_none_match, kwargs)) + + async def legacy_get_update_operation(self, operation_id, *, if_none_match=None, **kwargs): + return await get_update_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) + + update_operations.get_update = legacy_get_update + update_operations.get_file = legacy_get_file + setattr(update_operations, "get_operation", legacy_get_update_operation) + setattr(update_operations, "list_operations", list_update_operations) + + mappings = { + "get_operation": "get_operation_status", + "list_operations": "list_operation_statuses", + "get_group_update_compliance": "get_update_compliance_for_group", + "get_device_class_subgroup_details": "get_device_class_subgroup", + "list_best_updates_for_device_class_subgroup": "get_best_updates_for_device_class_subgroup", + "delete_device_class_subgroup_deployment": "delete_deployment_for_device_class_subgroup", + "list_devices_for_device_class_subgroup_deployment": "list_device_states_for_device_class_subgroup_deployment", + "collect_logs": "start_log_collection", + "get_log_collection_operation": "get_log_collection", + "list_log_collection_operations": "list_log_collections", + "get_log_collection_operation_detailed_status": "get_log_collection_detailed_status", + "list_device_health": "list_health_of_devices", + } + saved = {old: getattr(management_operations, new) for old, new in mappings.items()} + for old, method in saved.items(): + setattr(management_operations, old, method) + + get_management_operation = saved["get_operation"] + collect_logs = saved["collect_logs"] + get_log_collection = saved["get_log_collection_operation"] + get_log_collection_status = saved["get_log_collection_operation_detailed_status"] + + async def legacy_get_management_operation(self, operation_id, *, if_none_match=None, **kwargs): + return await get_management_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) + + setattr(management_operations, "get_operation", legacy_get_management_operation) + + async def legacy_collect_logs(self, operation_id, log_collection_request, **kwargs): + return await collect_logs(self, operation_id, log_collection_request, **kwargs) + + async def legacy_get_log_collection(self, operation_id, **kwargs): + return await get_log_collection(self, operation_id, **kwargs) + + async def legacy_get_log_collection_status(self, operation_id, **kwargs): + return await get_log_collection_status(self, operation_id, **kwargs) + + setattr(management_operations, "collect_logs", legacy_collect_logs) + setattr(management_operations, "get_log_collection_operation", legacy_get_log_collection) + setattr( + management_operations, + "get_log_collection_operation_detailed_status", + legacy_get_log_collection_status, + ) + + list_device_classes = management_operations.list_device_classes + list_groups = management_operations.list_groups + + list_group_deployments = management_operations.list_deployments_for_group + list_subgroup_deployments = management_operations.list_deployments_for_device_class_subgroup + list_best_updates = management_operations.list_best_updates_for_group + list_device_class_subgroups = management_operations.list_device_class_subgroups_for_group + + def legacy_list_device_classes(self, **kwargs): + return list_device_classes(self, **kwargs) + + def legacy_list_groups(self, *, orderby=None, **kwargs): + return list_groups(self, **_rename_orderby(orderby, kwargs)) + + def legacy_list_group_deployments(self, group_id, *, orderby=None, **kwargs): + return list_group_deployments(self, group_id, **_rename_orderby(orderby, kwargs)) + + def legacy_list_subgroup_deployments(self, group_id, device_class_id, *, orderby=None, **kwargs): + return list_subgroup_deployments(self, group_id, device_class_id, **_rename_orderby(orderby, kwargs)) + + def legacy_list_best_updates(self, group_id, *, filter=None, **kwargs): + if filter is not None: + params = dict(kwargs.pop("params", {}) or {}) + params["$filter"] = filter + kwargs["params"] = params + return list_best_updates(self, group_id, **kwargs) + + async def legacy_list_device_class_subgroups(self, group_id, *, filter=None, **kwargs): + return list_device_class_subgroups(self, group_id, filter=filter, **kwargs) + + management_operations.list_device_classes = legacy_list_device_classes + management_operations.list_groups = legacy_list_groups + management_operations.list_deployments_for_group = legacy_list_group_deployments + management_operations.list_deployments_for_device_class_subgroup = legacy_list_subgroup_deployments + management_operations.list_best_updates_for_group = legacy_list_best_updates + management_operations.list_device_class_subgroups_for_group = legacy_list_device_class_subgroups + + async def legacy_list_device_health(self, *, filter, **kwargs): + headers = kwargs.pop("headers", {}) or {} + params = kwargs.pop("params", {}) or {} + cls = kwargs.pop("cls", None) + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + request = _operations.build_device_management_list_health_of_devices_request( + instance_id=self._config.instance_id, + filter=filter, + api_version=self._config.api_version, + headers=headers, + params=params, + ) + request.url = self._client.format_url( + request.url, + endpoint=self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + ) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + if response.status_code != 200: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + deserialized = response.json() if response.content else None + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + setattr(management_operations, "list_device_health", legacy_list_device_health) + + for operation_name in { + "get_operation_status", + "list_operation_statuses", + "get_update_compliance_for_group", + "get_device_class_subgroup", + "get_best_updates_for_device_class_subgroup", + "delete_deployment_for_device_class_subgroup", + "list_device_states_for_device_class_subgroup_deployment", + "start_log_collection", + "get_log_collection", + "list_log_collections", + "get_log_collection_detailed_status", + "list_health_of_devices", + }: + delattr(management_operations, operation_name) + + delattr(update_operations, "get_operation_status") + delattr(update_operations, "list_operation_statuses") diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py index 87676c65a8f0..4ec80a127c47 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py @@ -7,6 +7,7 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +import sys __all__: list[str] = [] # Add all objects you want publicly available to users at this package level @@ -19,3 +20,5 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + models_module = sys.modules[__package__] + models_module.__all__.clear() diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py index 87676c65a8f0..2f3b31fd05e2 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py @@ -7,11 +7,41 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any, Optional, get_args +from azure.core import MatchConditions +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) + +from .._utils.model_base import _is_model __all__: list[str] = [] # Add all objects you want publicly available to users at this package level +def _contains_model(deserializer: Any) -> bool: + if _is_model(deserializer): + return True + return any(_contains_model(argument) for argument in get_args(deserializer)) + + +def _conditional_kwargs(if_none_match: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: + if if_none_match is not None: + kwargs["etag"] = if_none_match + kwargs["match_condition"] = MatchConditions.IfModified + return kwargs + + +def _rename_orderby(orderby: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: + kwargs["order_by"] = orderby + return kwargs + + def patch_sdk(): """Do not remove from this file. @@ -19,3 +49,165 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ + from . import _operations + + update_operations = _operations.DeviceUpdateOperations + management_operations = _operations.DeviceManagementOperations + + generated_deserialize = getattr(_operations, "_deserialize") + + def raw_model_deserialize(deserializer, value, *args, **kwargs): + if _contains_model(deserializer): + return value + return generated_deserialize(deserializer, value, *args, **kwargs) + + setattr(_operations, "_deserialize", raw_model_deserialize) + + get_update = update_operations.get_update + get_file = update_operations.get_file + get_update_operation = update_operations.get_operation_status + list_update_operations = update_operations.list_operation_statuses + + def legacy_get_update(self, provider, name, version, *, if_none_match=None, **kwargs): + return get_update(self, provider, name, version, **_conditional_kwargs(if_none_match, kwargs)) + + def legacy_get_file(self, provider, name, version, file_id, *, if_none_match=None, **kwargs): + return get_file(self, provider, name, version, file_id, **_conditional_kwargs(if_none_match, kwargs)) + + def legacy_get_update_operation(self, operation_id, *, if_none_match=None, **kwargs): + return get_update_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) + + update_operations.get_update = legacy_get_update + update_operations.get_file = legacy_get_file + setattr(update_operations, "get_operation", legacy_get_update_operation) + setattr(update_operations, "list_operations", list_update_operations) + + mappings = { + "get_operation": "get_operation_status", + "list_operations": "list_operation_statuses", + "get_group_update_compliance": "get_update_compliance_for_group", + "get_device_class_subgroup_details": "get_device_class_subgroup", + "list_best_updates_for_device_class_subgroup": "get_best_updates_for_device_class_subgroup", + "delete_device_class_subgroup_deployment": "delete_deployment_for_device_class_subgroup", + "list_devices_for_device_class_subgroup_deployment": "list_device_states_for_device_class_subgroup_deployment", + "collect_logs": "start_log_collection", + "get_log_collection_operation": "get_log_collection", + "list_log_collection_operations": "list_log_collections", + "get_log_collection_operation_detailed_status": "get_log_collection_detailed_status", + "list_device_health": "list_health_of_devices", + } + saved = {old: getattr(management_operations, new) for old, new in mappings.items()} + for old, method in saved.items(): + setattr(management_operations, old, method) + + get_management_operation = saved["get_operation"] + collect_logs = saved["collect_logs"] + get_log_collection = saved["get_log_collection_operation"] + get_log_collection_status = saved["get_log_collection_operation_detailed_status"] + + def legacy_get_management_operation(self, operation_id, *, if_none_match=None, **kwargs): + return get_management_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) + + setattr(management_operations, "get_operation", legacy_get_management_operation) + + def legacy_collect_logs(self, operation_id, log_collection_request, **kwargs): + return collect_logs(self, operation_id, log_collection_request, **kwargs) + + def legacy_get_log_collection(self, operation_id, **kwargs): + return get_log_collection(self, operation_id, **kwargs) + + def legacy_get_log_collection_status(self, operation_id, **kwargs): + return get_log_collection_status(self, operation_id, **kwargs) + + setattr(management_operations, "collect_logs", legacy_collect_logs) + setattr(management_operations, "get_log_collection_operation", legacy_get_log_collection) + setattr( + management_operations, + "get_log_collection_operation_detailed_status", + legacy_get_log_collection_status, + ) + + list_device_classes = management_operations.list_device_classes + list_groups = management_operations.list_groups + + list_group_deployments = management_operations.list_deployments_for_group + list_subgroup_deployments = management_operations.list_deployments_for_device_class_subgroup + list_best_updates = management_operations.list_best_updates_for_group + + def legacy_list_device_classes(self, **kwargs): + return list_device_classes(self, **kwargs) + + def legacy_list_groups(self, *, orderby=None, **kwargs): + return list_groups(self, **_rename_orderby(orderby, kwargs)) + + def legacy_list_group_deployments(self, group_id, *, orderby=None, **kwargs): + return list_group_deployments(self, group_id, **_rename_orderby(orderby, kwargs)) + + def legacy_list_subgroup_deployments(self, group_id, device_class_id, *, orderby=None, **kwargs): + return list_subgroup_deployments(self, group_id, device_class_id, **_rename_orderby(orderby, kwargs)) + + def legacy_list_best_updates(self, group_id, *, filter=None, **kwargs): + if filter is not None: + params = dict(kwargs.pop("params", {}) or {}) + params["$filter"] = filter + kwargs["params"] = params + return list_best_updates(self, group_id, **kwargs) + + management_operations.list_device_classes = legacy_list_device_classes + management_operations.list_groups = legacy_list_groups + management_operations.list_deployments_for_group = legacy_list_group_deployments + management_operations.list_deployments_for_device_class_subgroup = legacy_list_subgroup_deployments + management_operations.list_best_updates_for_group = legacy_list_best_updates + + def legacy_list_device_health(self, *, filter, **kwargs): + headers = kwargs.pop("headers", {}) or {} + params = kwargs.pop("params", {}) or {} + cls = kwargs.pop("cls", None) + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + request = _operations.build_device_management_list_health_of_devices_request( + instance_id=self._config.instance_id, + filter=filter, + api_version=self._config.api_version, + headers=headers, + params=params, + ) + request.url = self._client.format_url( + request.url, + endpoint=self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + ) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + if response.status_code != 200: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + deserialized = response.json() if response.content else None + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + setattr(management_operations, "list_device_health", legacy_list_device_health) + + for operation_name in { + "get_operation_status", + "list_operation_statuses", + "get_update_compliance_for_group", + "get_device_class_subgroup", + "get_best_updates_for_device_class_subgroup", + "delete_deployment_for_device_class_subgroup", + "list_device_states_for_device_class_subgroup_deployment", + "start_log_collection", + "get_log_collection", + "list_log_collections", + "get_log_collection_detailed_status", + "list_health_of_devices", + }: + delattr(management_operations, operation_name) + + delattr(update_operations, "get_operation_status") + delattr(update_operations, "list_operation_statuses") From 3f3b451733674ddbb5f7ddcdbcba0400cd477c9c Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Thu, 30 Jul 2026 17:04:28 -0400 Subject: [PATCH 03/11] Fix Device Update APIView compatibility surface --- .../azure/iot/deviceupdate/_patch.py | 14 +++++++++++--- .../azure/iot/deviceupdate/aio/_patch.py | 16 ++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py index ab943728ce93..42b6f6cae7e7 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py @@ -9,8 +9,11 @@ """ from typing import Any +from azure.core.credentials import TokenCredential +from azure.core.rest import HttpRequest, HttpResponse -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] def patch_sdk(): @@ -23,8 +26,13 @@ def patch_sdk(): from ._client import DeviceUpdateClient generated_init = DeviceUpdateClient.__init__ + generated_send_request = DeviceUpdateClient.send_request - def legacy_init(self, endpoint: str, instance_id: str, credential: Any, **kwargs: Any) -> None: + def __init__(self, endpoint: str, instance_id: str, credential: TokenCredential, **kwargs: Any) -> None: generated_init(self, endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) - DeviceUpdateClient.__init__ = legacy_init + def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + return generated_send_request(self, request, **kwargs) + + setattr(DeviceUpdateClient, "__init__", __init__) + setattr(DeviceUpdateClient, "send_request", send_request) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py index ab943728ce93..77497ed77c93 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py @@ -7,10 +7,13 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any +from typing import Any, Awaitable +from azure.core.credentials_async import AsyncTokenCredential +from azure.core.rest import AsyncHttpResponse, HttpRequest -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] def patch_sdk(): @@ -23,8 +26,13 @@ def patch_sdk(): from ._client import DeviceUpdateClient generated_init = DeviceUpdateClient.__init__ + generated_send_request = DeviceUpdateClient.send_request - def legacy_init(self, endpoint: str, instance_id: str, credential: Any, **kwargs: Any) -> None: + def __init__(self, endpoint: str, instance_id: str, credential: AsyncTokenCredential, **kwargs: Any) -> None: generated_init(self, endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) - DeviceUpdateClient.__init__ = legacy_init + def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + return generated_send_request(self, request, **kwargs) + + setattr(DeviceUpdateClient, "__init__", __init__) + setattr(DeviceUpdateClient, "send_request", send_request) From e4b08d4d88c3e61d72bea4a745458eee22251cba Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 30 Jul 2026 23:14:23 +0000 Subject: [PATCH 04/11] Configurations: 'specification/deviceupdate/data-plane/duiothub/tspconfig.yaml', API Version: 2026-06-01, SDK Release Type: stable, and CommitSHA: 'a1e083316c4db68aac174e4039aa47c618ba41c1' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6642486 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-iot-deviceupdate/CHANGELOG.md | 2 +- .../azure-iot-deviceupdate/_metadata.json | 2 +- .../azure-iot-deviceupdate/api.md | 1226 ++++---- .../azure-iot-deviceupdate/api.metadata.yml | 2 +- .../apiview-properties.json | 70 +- .../azure/iot/deviceupdate/_patch.py | 19 +- .../iot/deviceupdate/_utils/model_base.py | 1789 ----------- .../azure/iot/deviceupdate/aio/_patch.py | 19 +- .../aio/operations/_operations.py | 2631 ++++++++++++----- .../iot/deviceupdate/aio/operations/_patch.py | 197 -- .../azure/iot/deviceupdate/models/__init__.py | 128 - .../azure/iot/deviceupdate/models/_enums.py | 124 - .../azure/iot/deviceupdate/models/_models.py | 2156 -------------- .../azure/iot/deviceupdate/models/_patch.py | 24 - .../deviceupdate/operations/_operations.py | 2631 ++++++++++++----- .../iot/deviceupdate/operations/_patch.py | 192 -- .../azure/iot/deviceupdate/types.py | 269 -- .../azure-iot-deviceupdate/tsp-location.yaml | 2 +- 18 files changed, 4436 insertions(+), 7047 deletions(-) delete mode 100644 sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py delete mode 100644 sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/__init__.py delete mode 100644 sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_enums.py delete mode 100644 sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_models.py delete mode 100644 sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py delete mode 100644 sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md index 992f0a2c7e8c..9953f5d4e01e 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.1.0 (2026-07-29) +## 1.1.0 (2026-07-30) skip changelog generation for data-plane package and please add changelog manually. diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json index f1a5c7e5f91a..ccbe342f75f2 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json +++ b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json @@ -3,7 +3,7 @@ "apiVersions": { "DeviceUpdateClient": "2026-06-01" }, - "commit": "67ffbb6bee462e36bcdd3b93cffca6942c3a35f7", + "commit": "a1e083316c4db68aac174e4039aa47c618ba41c1", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "typespec_src": "specification/deviceupdate/data-plane/duiothub", "emitterVersion": "0.63.3", diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.md b/sdk/deviceupdate/azure-iot-deviceupdate/api.md index 42dced2340e6..2c374c860c33 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.md @@ -6,22 +6,26 @@ namespace azure.iot.deviceupdate device_update: DeviceUpdateOperations def __init__( - self, - endpoint: str, - instance_id: str, - credential: 'TokenCredential', + self, + endpoint: str, + credential: TokenCredential, + instance_id: str, + *, + api_version: str = ..., + polling_interval: Optional[int] = ..., **kwargs: Any ) -> None: ... + def close(self) -> None: ... + def send_request( - self, - request: HttpRequest, + self, + request: HttpRequest, + *, + stream: bool = False, **kwargs: Any ) -> HttpResponse: ... - def close( - self - ) -> None: ... namespace azure.iot.deviceupdate.aio @@ -30,379 +34,378 @@ namespace azure.iot.deviceupdate.aio device_update: DeviceUpdateOperations def __init__( - self, - endpoint: str, - instance_id: str, - credential: 'AsyncTokenCredential', + self, + endpoint: str, + credential: AsyncTokenCredential, + instance_id: str, + *, + api_version: str = ..., + polling_interval: Optional[int] = ..., **kwargs: Any ) -> None: ... + async def close(self) -> None: ... + def send_request( - self, - request: HttpRequest, + self, + request: HttpRequest, + *, + stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: ... - async def close( - self - ) -> None: ... namespace azure.iot.deviceupdate.aio.operations class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations: def __init__( - self, - *args, + self, + *args, **kwargs ) -> None: ... - @distributed_trace - def list_device_classes( - self, - **kwargs: Any - ) -> AsyncIterable[JSON]: ... - @distributed_trace_async - async def get_device_class( - self, - device_class_id: str, + async def begin_import_devices( + self, + import_type: str, **kwargs: Any - ) -> JSON: ... + ) -> AsyncLROPoller[None]: ... @overload - async def update_device_class( - self, - device_class_id: str, - device_class_patch: JSON, - *, - content_type: str = 'application/merge-patch+json', + async def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: JSON, + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... @overload - async def update_device_class( - self, - device_class_id: str, - device_class_patch: IO, - *, - content_type: str = 'application/merge-patch+json', + async def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... @distributed_trace_async - async def delete_device_class( - self, - device_class_id: str, + async def delete_deployment( + self, + group_id: str, + deployment_id: str, **kwargs: Any ) -> None: ... - @distributed_trace - def list_installable_updates_for_device_class( - self, - device_class_id: str, + @distributed_trace_async + async def delete_deployment_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> None: ... - @distributed_trace - def list_devices( - self, - *, - filter: Optional[str] = ..., + @distributed_trace_async + async def delete_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> None: ... @distributed_trace_async - async def begin_import_devices( - self, - import_type: str, + async def delete_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> None: ... @distributed_trace_async - async def get_device( - self, - device_id: str, + async def delete_group( + self, + group_id: str, **kwargs: Any - ) -> JSON: ... + ) -> None: ... @distributed_trace_async - async def get_device_module( - self, - device_id: str, - module_id: str, + async def get_best_updates_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace_async - async def get_update_compliance( - self, + async def get_deployment( + self, + group_id: str, + deployment_id: str, **kwargs: Any ) -> JSON: ... - @distributed_trace - def list_groups( - self, - *, - orderby: Optional[str] = ..., - **kwargs: Any - ) -> AsyncIterable[JSON]: ... - @distributed_trace_async - async def get_group( - self, - group_id: str, + async def get_deployment_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace_async - async def delete_group( - self, - group_id: str, + async def get_deployment_status( + self, + group_id: str, + deployment_id: str, **kwargs: Any - ) -> None: ... + ) -> JSON: ... @distributed_trace_async - async def get_group_update_compliance( - self, - group_id: str, + async def get_device( + self, + device_id: str, **kwargs: Any ) -> JSON: ... - @distributed_trace - def list_best_updates_for_group( - self, - group_id: str, - *, - filter: Optional[str] = ..., + @distributed_trace_async + async def get_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> JSON: ... - @distributed_trace - def list_deployments_for_group( - self, - group_id: str, - *, - orderby: Optional[str] = ..., + @distributed_trace_async + async def get_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> JSON: ... @distributed_trace_async - async def get_deployment( - self, - group_id: str, - deployment_id: str, + async def get_device_class_subgroup_deployment_status( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any ) -> JSON: ... - @overload - async def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: JSON, - *, - content_type: str = 'application/json', + @distributed_trace_async + async def get_device_class_subgroup_update_compliance( + self, + group_id: str, + device_class_id: str, **kwargs: Any ) -> JSON: ... - @overload - async def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: IO, - *, - content_type: str = 'application/json', + @distributed_trace_async + async def get_device_module( + self, + device_id: str, + module_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace_async - async def delete_deployment( - self, - group_id: str, - deployment_id: str, + async def get_group( + self, + group_id: str, **kwargs: Any - ) -> None: ... + ) -> JSON: ... @distributed_trace_async - async def get_deployment_status( - self, - group_id: str, - deployment_id: str, + async def get_log_collection( + self, + log_collection_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace_async - async def list_device_class_subgroups_for_group( - self, - group_id: str, - *, - filter: Optional[str] = ..., + async def get_log_collection_detailed_status( + self, + log_collection_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace_async - async def get_device_class_subgroup_details( - self, - group_id: str, - device_class_id: str, + async def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> JSON: ... @distributed_trace_async - async def delete_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - **kwargs: Any - ) -> None: ... + async def get_update_compliance(self, **kwargs: Any) -> JSON: ... @distributed_trace_async - async def get_device_class_subgroup_update_compliance( - self, - group_id: str, - device_class_id: str, + async def get_update_compliance_for_group( + self, + group_id: str, **kwargs: Any ) -> JSON: ... - @distributed_trace_async - async def list_best_updates_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, + @distributed_trace + def list_best_updates_for_group( + self, + group_id: str, **kwargs: Any - ) -> JSON: ... + ) -> AsyncItemPaged[JSON]: ... @distributed_trace def list_deployments_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - *, - orderby: Optional[str] = ..., + self, + group_id: str, + device_class_id: str, + *, + order_by: Optional[str] = ..., **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def get_deployment_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + @distributed_trace + def list_deployments_for_group( + self, + group_id: str, + *, + order_by: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def delete_device_class_subgroup_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + @distributed_trace + def list_device_class_subgroups_for_group( + self, + group_id: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> None: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def stop_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + @distributed_trace + def list_device_classes( + self, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def retry_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + @distributed_trace + def list_device_states_for_device_class_subgroup_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def get_device_class_subgroup_deployment_status( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + @distributed_trace + def list_devices( + self, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> AsyncItemPaged[JSON]: ... @distributed_trace - def list_devices_for_device_class_subgroup_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, - *, - filter: Optional[str] = ..., + def list_groups( + self, + *, + order_by: Optional[str] = ..., **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def get_operation( - self, - operation_id: str, - *, - if_none_match: Optional[str] = ..., + @distributed_trace + def list_health_of_devices( + self, + *, + filter: str, **kwargs: Any - ) -> Optional[JSON]: ... + ) -> AsyncItemPaged[JSON]: ... @distributed_trace - def list_operations( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., + def list_installable_updates_for_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> AsyncItemPaged[JSON]: ... - @overload - async def collect_logs( - self, - operation_id: str, - log_collection_request: JSON, - *, - content_type: str = 'application/json', + @distributed_trace + def list_log_collections(self, **kwargs: Any) -> AsyncItemPaged[JSON]: ... + + @distributed_trace + def list_operation_statuses( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., + **kwargs: Any + ) -> AsyncItemPaged[JSON]: ... + + @distributed_trace_async + async def retry_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any ) -> JSON: ... @overload - async def collect_logs( - self, - operation_id: str, - log_collection_request: IO, - *, - content_type: str = 'application/json', + async def start_log_collection( + self, + log_collection_id: str, + log_collection: JSON, + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... - @distributed_trace_async - async def get_log_collection_operation( - self, - operation_id: str, + @overload + async def start_log_collection( + self, + log_collection_id: str, + log_collection: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... - @distributed_trace - def list_log_collection_operations( - self, + @distributed_trace_async + async def stop_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> JSON: ... - @distributed_trace_async - async def get_log_collection_operation_detailed_status( - self, - operation_id: str, + @overload + async def update_device_class( + self, + device_class_id: str, + device_class_patch: JSON, + *, + content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: ... - @distributed_trace_async - async def list_device_health( - self, - *, - filter: str, + @overload + async def update_device_class( + self, + device_class_id: str, + device_class_patch: IO[bytes], + *, + content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: ... @@ -410,119 +413,119 @@ namespace azure.iot.deviceupdate.aio.operations class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations: def __init__( - self, - *args, + self, + *args, **kwargs ) -> None: ... - @distributed_trace - def list_updates( - self, - *, - search: Optional[str] = ..., - filter: Optional[str] = ..., + @distributed_trace_async + async def begin_delete_update( + self, + provider: str, + name: str, + version: str, **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> AsyncLROPoller[None]: ... @overload async def begin_import_update( - self, - update_to_import: list[JSON], - *, - content_type: str = 'application/json', + self, + update_to_import: list[JSON], + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @overload async def begin_import_update( - self, - update_to_import: IO, - *, - content_type: str = 'application/json', + self, + update_to_import: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: ... @distributed_trace_async - async def get_update( - self, - provider: str, - name: str, - version: str, - *, - if_none_match: Optional[str] = ..., + async def get_file( + self, + provider: str, + name: str, + version: str, + file_id: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> Optional[JSON]: ... + ) -> JSON: ... @distributed_trace_async - async def begin_delete_update( - self, - provider: str, - name: str, - version: str, + async def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> AsyncLROPoller[None]: ... + ) -> JSON: ... - @distributed_trace - def list_providers( - self, + @distributed_trace_async + async def get_update( + self, + provider: str, + name: str, + version: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> AsyncIterable[str]: ... + ) -> JSON: ... @distributed_trace - def list_names( - self, - provider: str, + def list_files( + self, + provider: str, + name: str, + version: str, **kwargs: Any - ) -> AsyncIterable[str]: ... + ) -> AsyncItemPaged[str]: ... @distributed_trace - def list_versions( - self, - provider: str, - name: str, - *, - filter: Optional[str] = ..., + def list_names( + self, + provider: str, **kwargs: Any - ) -> AsyncIterable[str]: ... + ) -> AsyncItemPaged[str]: ... @distributed_trace - def list_files( - self, - provider: str, - name: str, - version: str, + def list_operation_statuses( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., **kwargs: Any - ) -> AsyncIterable[str]: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def get_file( - self, - provider: str, - name: str, - version: str, - file_id: str, - *, - if_none_match: Optional[str] = ..., - **kwargs: Any - ) -> Optional[JSON]: ... + @distributed_trace + def list_providers(self, **kwargs: Any) -> AsyncItemPaged[str]: ... @distributed_trace - def list_operations( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., + def list_updates( + self, + *, + filter: Optional[str] = ..., + search: Optional[str] = ..., **kwargs: Any - ) -> AsyncIterable[JSON]: ... + ) -> AsyncItemPaged[JSON]: ... - @distributed_trace_async - async def get_operation( - self, - operation_id: str, - *, - if_none_match: Optional[str] = ..., + @distributed_trace + def list_versions( + self, + provider: str, + name: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> Optional[JSON]: ... + ) -> AsyncItemPaged[str]: ... namespace azure.iot.deviceupdate.operations @@ -530,357 +533,352 @@ namespace azure.iot.deviceupdate.operations class azure.iot.deviceupdate.operations.DeviceManagementOperations: def __init__( - self, - *args, + self, + *args, **kwargs ) -> None: ... @distributed_trace - def list_device_classes( - self, - **kwargs: Any - ) -> Iterable[JSON]: ... - - @distributed_trace - def get_device_class( - self, - device_class_id: str, + def begin_import_devices( + self, + import_type: str, **kwargs: Any - ) -> JSON: ... + ) -> LROPoller[None]: ... @overload - def update_device_class( - self, - device_class_id: str, - device_class_patch: JSON, - *, - content_type: str = 'application/merge-patch+json', + def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: JSON, + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... @overload - def update_device_class( - self, - device_class_id: str, - device_class_patch: IO, - *, - content_type: str = 'application/merge-patch+json', + def create_or_update_deployment( + self, + group_id: str, + deployment_id: str, + deployment: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... @distributed_trace - def delete_device_class( - self, - device_class_id: str, + def delete_deployment( + self, + group_id: str, + deployment_id: str, **kwargs: Any ) -> None: ... @distributed_trace - def list_installable_updates_for_device_class( - self, - device_class_id: str, + def delete_deployment_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> None: ... @distributed_trace - def list_devices( - self, - *, - filter: Optional[str] = ..., + def delete_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> None: ... @distributed_trace - def begin_import_devices( - self, - import_type: str, + def delete_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> LROPoller[None]: ... + ) -> None: ... @distributed_trace - def get_device( - self, - device_id: str, + def delete_group( + self, + group_id: str, **kwargs: Any - ) -> JSON: ... + ) -> None: ... @distributed_trace - def get_device_module( - self, - device_id: str, - module_id: str, + def get_best_updates_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace - def get_update_compliance( - self, + def get_deployment( + self, + group_id: str, + deployment_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace - def list_groups( - self, - *, - orderby: Optional[str] = ..., + def get_deployment_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> JSON: ... @distributed_trace - def get_group( - self, - group_id: str, + def get_deployment_status( + self, + group_id: str, + deployment_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace - def delete_group( - self, - group_id: str, + def get_device( + self, + device_id: str, **kwargs: Any - ) -> None: ... + ) -> JSON: ... @distributed_trace - def get_group_update_compliance( - self, - group_id: str, + def get_device_class( + self, + device_class_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace - def list_best_updates_for_group( - self, - group_id: str, - *, - filter: Optional[str] = ..., + def get_device_class_subgroup( + self, + group_id: str, + device_class_id: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> JSON: ... @distributed_trace - def list_deployments_for_group( - self, - group_id: str, - *, - orderby: Optional[str] = ..., + def get_device_class_subgroup_deployment_status( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> JSON: ... @distributed_trace - def get_deployment( - self, - group_id: str, - deployment_id: str, + def get_device_class_subgroup_update_compliance( + self, + group_id: str, + device_class_id: str, **kwargs: Any ) -> JSON: ... - @overload - def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: JSON, - *, - content_type: str = 'application/json', + @distributed_trace + def get_device_module( + self, + device_id: str, + module_id: str, **kwargs: Any ) -> JSON: ... - @overload - def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: IO, - *, - content_type: str = 'application/json', + @distributed_trace + def get_group( + self, + group_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace - def delete_deployment( - self, - group_id: str, - deployment_id: str, + def get_log_collection( + self, + log_collection_id: str, **kwargs: Any - ) -> None: ... + ) -> JSON: ... @distributed_trace - def get_deployment_status( - self, - group_id: str, - deployment_id: str, + def get_log_collection_detailed_status( + self, + log_collection_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace - def list_device_class_subgroups_for_group( - self, - group_id: str, - *, - filter: Optional[str] = ..., + def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any ) -> JSON: ... @distributed_trace - def get_device_class_subgroup_details( - self, - group_id: str, - device_class_id: str, + def get_update_compliance(self, **kwargs: Any) -> JSON: ... + + @distributed_trace + def get_update_compliance_for_group( + self, + group_id: str, **kwargs: Any ) -> JSON: ... @distributed_trace - def delete_device_class_subgroup( - self, - group_id: str, - device_class_id: str, + def list_best_updates_for_group( + self, + group_id: str, **kwargs: Any - ) -> None: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def get_device_class_subgroup_update_compliance( - self, - group_id: str, - device_class_id: str, + def list_deployments_for_device_class_subgroup( + self, + group_id: str, + device_class_id: str, + *, + order_by: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def list_best_updates_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, + def list_deployments_for_group( + self, + group_id: str, + *, + order_by: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def list_deployments_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - *, - orderby: Optional[str] = ..., + def list_device_class_subgroups_for_group( + self, + group_id: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def get_deployment_for_device_class_subgroup( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_device_classes( + self, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def delete_device_class_subgroup_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_device_states_for_device_class_subgroup_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> None: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def stop_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_devices( + self, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def retry_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_groups( + self, + *, + order_by: Optional[str] = ..., **kwargs: Any - ) -> JSON: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def get_device_class_subgroup_deployment_status( - self, - group_id: str, - device_class_id: str, - deployment_id: str, + def list_health_of_devices( + self, + *, + filter: str, **kwargs: Any - ) -> JSON: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def list_devices_for_device_class_subgroup_deployment( - self, - group_id: str, - device_class_id: str, - deployment_id: str, - *, - filter: Optional[str] = ..., + def list_installable_updates_for_device_class( + self, + device_class_id: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def get_operation( - self, - operation_id: str, - *, - if_none_match: Optional[str] = ..., - **kwargs: Any - ) -> Optional[JSON]: ... + def list_log_collections(self, **kwargs: Any) -> ItemPaged[JSON]: ... @distributed_trace - def list_operations( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., + def list_operation_statuses( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> ItemPaged[JSON]: ... - @overload - def collect_logs( - self, - operation_id: str, - log_collection_request: JSON, - *, - content_type: str = 'application/json', + @distributed_trace + def retry_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any ) -> JSON: ... @overload - def collect_logs( - self, - operation_id: str, - log_collection_request: IO, - *, - content_type: str = 'application/json', + def start_log_collection( + self, + log_collection_id: str, + log_collection: JSON, + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... - @distributed_trace - def get_log_collection_operation( - self, - operation_id: str, + @overload + def start_log_collection( + self, + log_collection_id: str, + log_collection: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any ) -> JSON: ... @distributed_trace - def list_log_collection_operations( - self, + def stop_deployment( + self, + group_id: str, + device_class_id: str, + deployment_id: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> JSON: ... - @distributed_trace - def get_log_collection_operation_detailed_status( - self, - operation_id: str, + @overload + def update_device_class( + self, + device_class_id: str, + device_class_patch: JSON, + *, + content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: ... - @distributed_trace - def list_device_health( - self, - *, - filter: str, + @overload + def update_device_class( + self, + device_class_id: str, + device_class_patch: IO[bytes], + *, + content_type: str = "application/merge-patch+json", **kwargs: Any ) -> JSON: ... @@ -888,119 +886,119 @@ namespace azure.iot.deviceupdate.operations class azure.iot.deviceupdate.operations.DeviceUpdateOperations: def __init__( - self, - *args, + self, + *args, **kwargs ) -> None: ... @distributed_trace - def list_updates( - self, - *, - search: Optional[str] = ..., - filter: Optional[str] = ..., + def begin_delete_update( + self, + provider: str, + name: str, + version: str, **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> LROPoller[None]: ... @overload def begin_import_update( - self, - update_to_import: list[JSON], - *, - content_type: str = 'application/json', + self, + update_to_import: list[JSON], + *, + content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @overload def begin_import_update( - self, - update_to_import: IO, - *, - content_type: str = 'application/json', + self, + update_to_import: IO[bytes], + *, + content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: ... @distributed_trace - def get_update( - self, - provider: str, - name: str, - version: str, - *, - if_none_match: Optional[str] = ..., + def get_file( + self, + provider: str, + name: str, + version: str, + file_id: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> Optional[JSON]: ... + ) -> JSON: ... @distributed_trace - def begin_delete_update( - self, - provider: str, - name: str, - version: str, + def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> LROPoller[None]: ... + ) -> JSON: ... @distributed_trace - def list_providers( - self, + def get_update( + self, + provider: str, + name: str, + version: str, + *, + etag: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> Iterable[str]: ... + ) -> JSON: ... @distributed_trace - def list_names( - self, - provider: str, + def list_files( + self, + provider: str, + name: str, + version: str, **kwargs: Any - ) -> Iterable[str]: ... + ) -> ItemPaged[str]: ... @distributed_trace - def list_versions( - self, - provider: str, - name: str, - *, - filter: Optional[str] = ..., + def list_names( + self, + provider: str, **kwargs: Any - ) -> Iterable[str]: ... + ) -> ItemPaged[str]: ... @distributed_trace - def list_files( - self, - provider: str, - name: str, - version: str, + def list_operation_statuses( + self, + *, + filter: Optional[str] = ..., + top: Optional[int] = ..., **kwargs: Any - ) -> Iterable[str]: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def get_file( - self, - provider: str, - name: str, - version: str, - file_id: str, - *, - if_none_match: Optional[str] = ..., - **kwargs: Any - ) -> Optional[JSON]: ... + def list_providers(self, **kwargs: Any) -> ItemPaged[str]: ... @distributed_trace - def list_operations( - self, - *, - filter: Optional[str] = ..., - top: Optional[int] = ..., + def list_updates( + self, + *, + filter: Optional[str] = ..., + search: Optional[str] = ..., **kwargs: Any - ) -> Iterable[JSON]: ... + ) -> ItemPaged[JSON]: ... @distributed_trace - def get_operation( - self, - operation_id: str, - *, - if_none_match: Optional[str] = ..., + def list_versions( + self, + provider: str, + name: str, + *, + filter: Optional[str] = ..., **kwargs: Any - ) -> Optional[JSON]: ... + ) -> ItemPaged[str]: ... -``` +``` \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml index 555c54025812..d0148e9dd6e7 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 6d64fd40512f73229386ae3dbf5471b9411b77f6bb7acd56c6a50829ec725697 +apiMdSha256: 882e4cfe462148f114ff430c460be79a27b5b447a7107cfd0bab4b508020f70f parserVersion: 0.3.30 pythonVersion: 3.13.14 diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json index fd6ab75616b2..e48087718be1 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json +++ b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json @@ -1,6 +1,16 @@ { "CrossLanguagePackageId": "DeviceUpdateClient", "CrossLanguageDefinitionId": { + "azure.iot.deviceupdate.models.StepType": "DeviceUpdateClient.StepType", + "azure.iot.deviceupdate.models.OperationStatus": "DeviceUpdateClient.OperationStatus", + "azure.iot.deviceupdate.models.DeviceDeploymentState": "DeviceUpdateClient.DeviceDeploymentState", + "azure.iot.deviceupdate.models.ImportType": "DeviceUpdateClient.ImportType", + "azure.iot.deviceupdate.models.GroupType": "DeviceUpdateClient.GroupType", + "azure.iot.deviceupdate.models.DownloadSecurity": "DeviceUpdateClient.DownloadSecurity", + "azure.iot.deviceupdate.models.DeploymentState": "DeviceUpdateClient.DeploymentState", + "azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState": "DeviceUpdateClient.DeviceClassSubgroupDeploymentState", + "azure.iot.deviceupdate.models.DeviceHealthState": "DeviceUpdateClient.DeviceHealthState", + "azure.iot.deviceupdate.models.HealthCheckResult": "DeviceUpdateClient.HealthCheckResult", "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", @@ -19,10 +29,10 @@ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", - "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", - "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", + "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", + "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", @@ -49,8 +59,8 @@ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", @@ -65,42 +75,42 @@ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_details": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_details": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.collect_logs": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.collect_logs": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_operation": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collection_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collection_operations": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_operation_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_operation_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", - "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_health": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices", - "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_health": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices" + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", + "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices", + "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices" }, - "CrossLanguageVersion": "c1a73ac75a65" -} + "CrossLanguageVersion": "d34f44a67a46" +} \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py index 42b6f6cae7e7..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py @@ -7,13 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any -from azure.core.credentials import TokenCredential -from azure.core.rest import HttpRequest, HttpResponse - -__all__: list[str] = [] +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): @@ -23,16 +19,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - from ._client import DeviceUpdateClient - - generated_init = DeviceUpdateClient.__init__ - generated_send_request = DeviceUpdateClient.send_request - - def __init__(self, endpoint: str, instance_id: str, credential: TokenCredential, **kwargs: Any) -> None: - generated_init(self, endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) - - def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: - return generated_send_request(self, request, **kwargs) - - setattr(DeviceUpdateClient, "__init__", __init__) - setattr(DeviceUpdateClient, "send_request", send_request) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py deleted file mode 100644 index 1934415c1369..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py +++ /dev/null @@ -1,1789 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=protected-access, broad-except - -import copy -import calendar -import decimal -import functools -import sys -import logging -import base64 -import re -import typing -import enum -import email.utils -from datetime import datetime, date, time, timedelta, timezone -from json import JSONEncoder -import xml.etree.ElementTree as ET -from collections.abc import MutableMapping -import isodate -from azure.core.exceptions import DeserializationError -from azure.core import CaseInsensitiveEnumMeta -from azure.core.pipeline import PipelineResponse -from azure.core.serialization import _Null - -from azure.core.rest import HttpResponse - -if sys.version_info >= (3, 11): - from typing import Self -else: - from typing_extensions import Self - -_LOGGER = logging.getLogger(__name__) - -__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] - -TZ_UTC = timezone.utc -_T = typing.TypeVar("_T") -_NONE_TYPE = type(None) - - -def _timedelta_as_isostr(td: timedelta) -> str: - """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' - - Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython - - :param timedelta td: The timedelta to convert - :rtype: str - :return: ISO8601 version of this timedelta - """ - - # Split seconds to larger units - seconds = td.total_seconds() - minutes, seconds = divmod(seconds, 60) - hours, minutes = divmod(minutes, 60) - days, hours = divmod(hours, 24) - - days, hours, minutes = list(map(int, (days, hours, minutes))) - seconds = round(seconds, 6) - - # Build date - date_str = "" - if days: - date_str = "%sD" % days - - if hours or minutes or seconds: - # Build time - time_str = "T" - - # Hours - bigger_exists = date_str or hours - if bigger_exists: - time_str += "{:02}H".format(hours) - - # Minutes - bigger_exists = bigger_exists or minutes - if bigger_exists: - time_str += "{:02}M".format(minutes) - - # Seconds - try: - if seconds.is_integer(): - seconds_string = "{:02}".format(int(seconds)) - else: - # 9 chars long w/ leading 0, 6 digits after decimal - seconds_string = "%09.6f" % seconds - # Remove trailing zeros - seconds_string = seconds_string.rstrip("0") - except AttributeError: # int.is_integer() raises - seconds_string = "{:02}".format(seconds) - - time_str += "{}S".format(seconds_string) - else: - time_str = "" - - return "P" + date_str + time_str - - -def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: - encoded = base64.b64encode(o).decode() - if format == "base64url": - return encoded.strip("=").replace("+", "-").replace("/", "_") - return encoded - - -def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): - """Serialize a timedelta to its wire representation. - - For the ``seconds``/``milliseconds`` encodings the value is converted to a - numeric value, otherwise it falls back to an ISO 8601 duration string. - - :param timedelta td: The timedelta to serialize. - :param str format: The duration encoding format. - :rtype: int or float or str - :return: serialized duration - """ - seconds = td.total_seconds() - if format == "duration-seconds-int": - return int(seconds) - if format == "duration-seconds-float": - return seconds - if format == "duration-milliseconds-int": - return int(seconds * 1000) - if format == "duration-milliseconds-float": - return seconds * 1000 - return _timedelta_as_isostr(td) - - -def _serialize_datetime(o, format: typing.Optional[str] = None): - if hasattr(o, "year") and hasattr(o, "hour"): - if format == "rfc7231": - return email.utils.format_datetime(o, usegmt=True) - if format == "unix-timestamp": - return int(calendar.timegm(o.utctimetuple())) - - # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) - if not o.tzinfo: - iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() - else: - iso_formatted = o.astimezone(TZ_UTC).isoformat() - # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) - return iso_formatted.replace("+00:00", "Z") - # Next try datetime.date or datetime.time - return o.isoformat() - - -def _is_readonly(p): - try: - return p._visibility == ["read"] - except AttributeError: - return False - - -class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" - - def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): - super().__init__(*args, **kwargs) - self.exclude_readonly = exclude_readonly - self.format = format - - def default(self, o): # pylint: disable=too-many-return-statements - if _is_model(o): - if self.exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - return {k: v for k, v in o.items() if k not in readonly_props} - return dict(o.items()) - try: - return super(SdkJSONEncoder, self).default(o) - except TypeError: - if isinstance(o, _Null): - return None - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, self.format) - try: - # First try datetime.datetime - return _serialize_datetime(o, self.format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _timedelta_as_isostr(o) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return super(SdkJSONEncoder, self).default(o) - - -_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") -_VALID_RFC7231 = re.compile( - r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" - r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" -) - -_ARRAY_ENCODE_MAPPING = { - "pipeDelimited": "|", - "spaceDelimited": " ", - "commaDelimited": ",", - "newlineDelimited": "\n", -} - - -def _deserialize_array_encoded(delimit: str, attr): - if isinstance(attr, str): - if attr == "": - return [] - return attr.split(delimit) - return attr - - -def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize ISO-8601 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - attr = attr.upper() - match = _VALID_DATE.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - check_decimal = attr.split(".") - if len(check_decimal) > 1: - decimal_str = "" - for digit in check_decimal[1]: - if digit.isdigit(): - decimal_str += digit - else: - break - if len(decimal_str) > 6: - attr = attr.replace(decimal_str, decimal_str[0:6]) - - date_obj = isodate.parse_datetime(attr) - test_utc = date_obj.utctimetuple() - if test_utc.tm_year > 9999 or test_utc.tm_year < 1: - raise OverflowError("Hit max or min date") - return date_obj # type: ignore[no-any-return] - - -def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: - """Deserialize RFC7231 formatted string into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - match = _VALID_RFC7231.match(attr) - if not match: - raise ValueError("Invalid datetime string: " + attr) - - return email.utils.parsedate_to_datetime(attr) - - -def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: - """Deserialize unix timestamp into Datetime object. - - :param str attr: response string to be deserialized. - :rtype: ~datetime.datetime - :returns: The datetime object from that input - """ - if isinstance(attr, datetime): - # i'm already deserialized - return attr - return datetime.fromtimestamp(attr, TZ_UTC) - - -def _deserialize_date(attr: typing.Union[str, date]) -> date: - """Deserialize ISO-8601 formatted string into Date object. - :param str attr: response string to be deserialized. - :rtype: date - :returns: The date object from that input - """ - # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. - if isinstance(attr, date): - return attr - return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore - - -def _deserialize_time(attr: typing.Union[str, time]) -> time: - """Deserialize ISO-8601 formatted string into time object. - - :param str attr: response string to be deserialized. - :rtype: datetime.time - :returns: The time object from that input - """ - if isinstance(attr, time): - return attr - return isodate.parse_time(attr) # type: ignore[no-any-return] - - -def _deserialize_bytes(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - return bytes(base64.b64decode(attr)) - - -def _deserialize_bytes_base64(attr): - if isinstance(attr, (bytes, bytearray)): - return attr - padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore - attr = attr + padding # type: ignore - encoded = attr.replace("-", "+").replace("_", "/") - return bytes(base64.b64decode(encoded)) - - -def _deserialize_duration(attr): - if isinstance(attr, timedelta): - return attr - return isodate.parse_duration(attr) - - -def _deserialize_duration_numeric(attr, unit): - if isinstance(attr, timedelta): - return attr - return timedelta(**{unit: float(attr)}) - - -def _deserialize_decimal(attr): - if isinstance(attr, decimal.Decimal): - return attr - return decimal.Decimal(str(attr)) - - -def _deserialize_int_as_str(attr): - if isinstance(attr, int): - return attr - return int(attr) - - -_DESERIALIZE_MAPPING = { - datetime: _deserialize_datetime, - date: _deserialize_date, - time: _deserialize_time, - bytes: _deserialize_bytes, - bytearray: _deserialize_bytes, - timedelta: _deserialize_duration, - typing.Any: lambda x: x, - decimal.Decimal: _deserialize_decimal, -} - -_DESERIALIZE_MAPPING_WITHFORMAT = { - "rfc3339": _deserialize_datetime, - "rfc7231": _deserialize_datetime_rfc7231, - "unix-timestamp": _deserialize_datetime_unix_timestamp, - "base64": _deserialize_bytes, - "base64url": _deserialize_bytes_base64, - "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), - "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), - "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), - "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), -} - - -def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): - if annotation is int and rf and rf._format == "str": - return _deserialize_int_as_str - if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: - return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) - if rf and rf._format: - return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) - return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore - - -def _get_type_alias_type(module_name: str, alias_name: str): - types = { - k: v - for k, v in sys.modules[module_name].__dict__.items() - if isinstance(v, typing._GenericAlias) # type: ignore - } - if alias_name not in types: - return alias_name - return types[alias_name] - - -def _get_model(module_name: str, model_name: str): - models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} - module_end = module_name.rsplit(".", 1)[0] - models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) - if isinstance(model_name, str): - model_name = model_name.split(".")[-1] - if model_name not in models: - return model_name - return models[model_name] - - -_UNSET = object() - - -class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: dict[str, typing.Any]) -> None: - self._data = data - - def __contains__(self, key: typing.Any) -> bool: - return key in self._data - - def __getitem__(self, key: str) -> typing.Any: - # If this key has been deserialized (for mutable types), we need to handle serialization - if hasattr(self, "_attr_to_rest_field"): - cache_attr = f"_deserialized_{key}" - if hasattr(self, cache_attr): - rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) - if rf: - value = self._data.get(key) - if isinstance(value, (dict, list, set)): - # For mutable types, serialize and return - # But also update _data with serialized form and clear flag - # so mutations via this returned value affect _data - serialized = _serialize(value, rf._format) - # If serialized form is same type (no transformation needed), - # return _data directly so mutations work - if isinstance(serialized, type(value)) and serialized == value: - return self._data.get(key) - # Otherwise return serialized copy and clear flag - try: - object.__delattr__(self, cache_attr) - except AttributeError: - pass - # Store serialized form back - self._data[key] = serialized - return serialized - return self._data.__getitem__(key) - - def __setitem__(self, key: str, value: typing.Any) -> None: - # Clear any cached deserialized value when setting through dictionary access - cache_attr = f"_deserialized_{key}" - try: - object.__delattr__(self, cache_attr) - except AttributeError: - pass - self._data.__setitem__(key, value) - - def __delitem__(self, key: str) -> None: - self._data.__delitem__(key) - - def __iter__(self) -> typing.Iterator[typing.Any]: - return self._data.__iter__() - - def __len__(self) -> int: - return self._data.__len__() - - def __ne__(self, other: typing.Any) -> bool: - return not self.__eq__(other) - - def keys(self) -> typing.KeysView[str]: - """ - :returns: a set-like object providing a view on the mapping's keys - :rtype: ~typing.KeysView - """ - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - """ - :returns: an object providing a view on the mapping's values - :rtype: ~typing.ValuesView - """ - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - """ - :returns: a set-like object providing a view on the mapping's items - :rtype: ~typing.ItemsView - """ - return self._data.items() - - def get(self, key: str, default: typing.Any = None) -> typing.Any: - """ - Get the value for key if key is in the dictionary, else default. - :param str key: The key to look up. - :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: The value for key if key is in the dictionary, else default. - :rtype: any - """ - try: - return self[key] - except KeyError: - return default - - @typing.overload - def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ - - @typing.overload - def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs - - @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs - - def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - """ - Removes specified key and return the corresponding value. - :param str key: The key to pop. - :param any default: The value to return if key is not in the dictionary - :returns: The value corresponding to the key. - :rtype: any - :raises KeyError: If key is not found and default is not given. - """ - if default is _UNSET: - return self._data.pop(key) - return self._data.pop(key, default) - - def popitem(self) -> tuple[str, typing.Any]: - """ - Removes and returns some (key, value) pair - :returns: The (key, value) pair. - :rtype: tuple - :raises KeyError: if the dictionary is empty. - """ - return self._data.popitem() - - def clear(self) -> None: - """ - Remove all items from the dictionary. - """ - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ - """ - Update the dictionary from a mapping or an iterable of key-value pairs. - :param any args: Either a mapping object or an iterable of key-value pairs. - """ - self._data.update(*args, **kwargs) - - @typing.overload - def setdefault(self, key: str, default: None = None) -> None: ... - - @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs - - def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - """ - Return the value for key if key is in the dictionary; otherwise set the key to - default and return default. - :param str key: The key to look up. - :param any default: The value to set if key is not in the dictionary - :returns: The value for key if key is in the dictionary, else default. - :rtype: any - """ - if default is _UNSET: - return self._data.setdefault(key) - return self._data.setdefault(key, default) - - def __eq__(self, other: typing.Any) -> bool: - if isinstance(other, _MyMutableMapping): - return self._data == other._data - try: - other_model = self.__class__(other) - except Exception: - return False - return self._data == other_model._data - - def __repr__(self) -> str: - return str(self._data) - - -def _is_model(obj: typing.Any) -> bool: - return getattr(obj, "_is_model", False) - - -def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements - if isinstance(o, list): - if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): - return _ARRAY_ENCODE_MAPPING[format].join(o) - return [_serialize(x, format) for x in o] - if isinstance(o, dict): - return {k: _serialize(v, format) for k, v in o.items()} - if isinstance(o, set): - return {_serialize(x, format) for x in o} - if isinstance(o, tuple): - return tuple(_serialize(x, format) for x in o) - if isinstance(o, (bytes, bytearray)): - return _serialize_bytes(o, format) - if isinstance(o, decimal.Decimal): - return float(o) - if isinstance(o, enum.Enum): - return o.value - if isinstance(o, int): - if format == "str": - return str(o) - return o - try: - # First try datetime.datetime - return _serialize_datetime(o, format) - except AttributeError: - pass - # Last, try datetime.timedelta - try: - return _serialize_duration(o, format) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass - return o - - -def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: - try: - return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) - except StopIteration: - return None - - -def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: - if not rf: - return _serialize(value, None) - if rf._is_multipart_file_input: - return value - if rf._is_model: - return _deserialize(rf._type, value) - if isinstance(value, ET.Element): - value = _deserialize(rf._type, value) - return _serialize(value, rf._format) - - -# ============================================================================ -# Fast-path scalar deserializer functions for rest_field(deserializer=...) -# These are referenced from rest_field declarations to bypass the generic -# _deserialize -> _deserialize_with_callable chain. -# Only simple/primitive types — no models or container types. -# ============================================================================ - - -def _xml_deser_str(value): - if isinstance(value, ET.Element): - return value.text or "" - return str(value) if value is not None else None - - -def _xml_deser_int(value): - if isinstance(value, ET.Element): - return int(value.text) if value.text else None - return int(value) if value is not None else None - - -def _xml_deser_float(value): - if isinstance(value, ET.Element): - return float(value.text) if value.text else None - return float(value) if value is not None else None - - -def _xml_deser_bool(value): - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - if text in (True, False): - return text - return text.lower() == "true" - - -# pylint: disable=docstring-missing-param -def _xml_deser_bytes(value): - """Deserialize bytes from XML (base64).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_bytes(text) - - -def _xml_deser_bytes_base64url(value): - """Deserialize bytes from XML (base64url).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_bytes_base64(text) - - -def _xml_deser_datetime(value): - """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime(text) - - -def _xml_deser_datetime_rfc7231(value): - """Deserialize a datetime from XML (RFC7231 format).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime_rfc7231(text) - - -def _xml_deser_datetime_unix_timestamp(value): - """Deserialize a datetime from XML (Unix timestamp).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_datetime_unix_timestamp(float(text)) - - -def _xml_deser_date(value): - """Deserialize a date from XML (ISO 8601).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_date(text) - - -def _xml_deser_time(value): - """Deserialize a time from XML (ISO 8601).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_time(text) - - -def _xml_deser_duration(value): - """Deserialize a timedelta from XML (ISO 8601 duration).""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_duration(text) - - -def _xml_deser_decimal(value): - """Deserialize a Decimal from XML.""" - if isinstance(value, ET.Element): - text = value.text - else: - text = value - if text is None: - return None - return _deserialize_decimal(text) - - -def _xml_deser_enum_or_str(enum_cls, value): - """Deserialize a Union[EnumType, str] from XML.""" - text = value.text if isinstance(value, ET.Element) else value - if text is None: - return None - try: - return enum_cls(text) - except ValueError: - return text - - -def _extract_xml_model_type(rf_type): - """Extract the concrete Model class from a resolved rf._type partial chain. - - Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` - wrappers. Only handles Model and Optional[Model] — other composite - types (List, Dict, Union, etc.) return None and fall through to the - generic ``_deserialize`` path at runtime. - """ - if rf_type is None: - return None - if isinstance(rf_type, type) and _is_model(rf_type): - return rf_type - if not isinstance(rf_type, functools.partial): - return None - func = rf_type.func - args = rf_type.args - if func is _deserialize_with_optional and args: - return _extract_xml_model_type(args[0]) - if func is _deserialize_model and args: - cls = args[0] - return cls if isinstance(cls, type) and _is_model(cls) else None - return None - - -def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable - cls, attr_to_rest_field: dict -) -> list: - """Build a precomputed XML field plan for fast _init_from_xml iteration. - - Called once per model class in __new__. Returns a list of tuples: - (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) - - kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text - - For Model and Optional[Model] fields that lack a scalar - ``_deserializer``, this function precomputes the Model class as the - deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` - directly instead of going through the expensive - ``_get_deserialize_callable_from_annotation`` chain at runtime. - """ - model_meta = getattr(cls, "_xml", {}) - model_ns = model_meta.get("ns") or model_meta.get("namespace") - plan = [] - - for rf in attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - deser = rf._deserializer - - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - is_optional = rf._is_optional - - # For Model / Optional[Model] fields without a scalar deserializer, - # precompute the Model class as the deserializer. - if deser is None and rf._type is not None: - model_cls = _extract_xml_model_type(rf._type) - if model_cls is not None: - deser = model_cls - - if prop_meta.get("attribute", False): - plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) - elif prop_meta.get("unwrapped", False): - items_name = prop_meta.get("itemsName") - if items_name: - items_ns = prop_meta.get("itemsNs") - if items_ns is not None: - xml_ns = items_ns - if xml_ns: - items_name = "{" + xml_ns + "}" + items_name - else: - items_name = xml_name - plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) - elif prop_meta.get("text", False): - plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) - else: - plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) - - return plan - - -# pylint: enable=docstring-missing-param -class Model(_MyMutableMapping): - _is_model = True - # label whether current class's _attr_to_rest_field has been calculated - # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: set[str] = set() - - def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: - class_name = self.__class__.__name__ - if len(args) > 1: - raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass: dict[str, typing.Any] = {} - if args: - if isinstance(args[0], ET.Element): - dict_to_pass.update(self._init_from_xml(args[0])) - else: - dict_to_pass.update( - {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} - ) - else: - non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] - if non_attr_kwargs: - # actual type errors only throw the first wrong keyword arg they see, so following that. - raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") - dict_to_pass.update( - { - self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) - for k, v in kwargs.items() - if v is not None - } - ) - # Apply client default values for fields the caller didn't set so that - # defaults are part of `_data` and therefore included during serialization. - for rf in self._attr_to_rest_field.values(): - if rf._default is _UNSET: - continue - if rf._rest_name in dict_to_pass: - continue - dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) - super().__init__(dict_to_pass) - - def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements - self, element: ET.Element - ) -> dict[str, typing.Any]: - """Deserialize an XML element into a dict mapping rest field names to values. - - :param ET.Element element: The XML element to deserialize from. - :returns: A dictionary of rest_name to deserialized value pairs. - :rtype: dict - """ - result: dict[str, typing.Any] = {} - existed_attr_keys: list[str] = [] - - field_plan = getattr(self, "_xml_field_plan", None) - if field_plan: - for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: - if kind == 0: # wrapped element (most common) - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - if deser: - result[rest_name] = deser(item) - else: - result[rest_name] = _deserialize(rf_type, item) - elif kind == 1: # attribute - attr_val = element.get(xml_name) - if attr_val is not None: - existed_attr_keys.append(xml_name) - if deser: - result[rest_name] = deser(attr_val) - else: - result[rest_name] = attr_val - elif kind == 2: # unwrapped array - items = element.findall(items_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(items_name) - if deser: - result[rest_name] = deser(items) - else: - result[rest_name] = _deserialize(rf_type, items) - elif not is_optional: - existed_attr_keys.append(items_name) - result[rest_name] = [] - elif kind == 3: # text - if element.text is not None: - if deser: - result[rest_name] = deser(element.text) - else: - result[rest_name] = element.text - else: - model_meta = getattr(self, "_xml", {}) - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and element.get(xml_name) is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - _items_name = prop_meta.get("itemsName") - if _items_name: - xml_name = _items_name - _items_ns = prop_meta.get("itemsNs") - if _items_ns is not None: - xml_ns = _items_ns - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = element.findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if element.text is not None: - result[rf._rest_name] = _deserialize(rf._type, element.text) - continue - - # wrapped element could be normal property or array - item = element.find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - result[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in element: - if e.tag not in existed_attr_keys: - result[e.tag] = _convert_element(e) - - return result - - def copy(self) -> "Model": - return Model(self.__dict__) - - def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: - if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: - # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', - # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' - mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property - k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") - } - annotations = { - k: v - for mro_class in mros - if hasattr(mro_class, "__annotations__") - for k, v in mro_class.__annotations__.items() - } - for attr, rf in attr_to_rest_field.items(): - rf._module = cls.__module__ - if not rf._type: - rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) - if not rf._rest_name_input: - rf._rest_name_input = attr - cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) - cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { - Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf - for attr, rf in cls._attr_to_rest_field.items() - } - # Build XML field plan for fast _init_from_xml (only for XML models) - if getattr(cls, "_xml", None): - cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) - cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - - return super().__new__(cls) - - def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: - for base in cls.__bases__: - if hasattr(base, "__mapping__"): - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore - - @classmethod - def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: - rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access - if rest_field_obj is None: - return attr_name - original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access - if original_tsp_name: - return original_tsp_name - return attr_name - - @classmethod - def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: - for v in cls.__dict__.values(): - if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: - return v - return None - - @classmethod - def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): - return cls(data) - discriminator = cls._get_discriminator(exist_discriminators) - if discriminator is None: - return cls(data) - exist_discriminators.append(discriminator._rest_name) - if isinstance(data, ET.Element): - model_meta = getattr(cls, "_xml", {}) - prop_meta = getattr(discriminator, "_xml", {}) - xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = _resolve_xml_ns(prop_meta, model_meta) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - if data.get(xml_name) is not None: - discriminator_value = data.get(xml_name) - else: - discriminator_value = data.find(xml_name).text # pyright: ignore - else: - discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member - return mapped_cls._deserialize(data, exist_discriminators) - - def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: - """Return a dict that can be turned into json using json.dump. - - :keyword bool exclude_readonly: Whether to remove the readonly properties. - :returns: A dict JSON compatible object - :rtype: dict - """ - - result = {} - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] - for k, v in self.items(): - if exclude_readonly and k in readonly_props: # pyright: ignore - continue - is_multipart_file_input = False - try: - is_multipart_file_input = next( - rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k - )._is_multipart_file_input - except StopIteration: - pass - result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) - return result - - @staticmethod - def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: - if v is None or isinstance(v, _Null): - return None - if isinstance(v, (list, tuple, set)): - return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) - if isinstance(v, dict): - return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} - return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v - - -def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): - if _is_model(obj): - return obj - return _deserialize(model_deserializer, obj) - - -def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): - if obj is None: - return obj - return _deserialize_with_callable(if_obj_deserializer, obj) - - -def _deserialize_with_union(deserializers, obj): - for deserializer in deserializers: - try: - return _deserialize(deserializer, obj) - except DeserializationError: - pass - raise DeserializationError() - - -def _deserialize_dict( - value_deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj: dict[typing.Any, typing.Any], -): - if obj is None: - return obj - if isinstance(obj, ET.Element): - obj = {child.tag: child for child in obj} - return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} - - -def _deserialize_multiple_sequence( - entry_deserializers: list[typing.Optional[typing.Callable]], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) - - -def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: - return ( - isinstance(deserializer, functools.partial) - and isinstance(deserializer.args[0], functools.partial) - and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable - ) - - -def _deserialize_sequence( - deserializer: typing.Optional[typing.Callable], - module: typing.Optional[str], - obj, -): - if obj is None: - return obj - if isinstance(obj, ET.Element): - obj = list(obj) - - # encoded string may be deserialized to sequence - if isinstance(obj, str) and isinstance(deserializer, functools.partial): - # for list[str] - if _is_array_encoded_deserializer(deserializer): - return deserializer(obj) - - # for list[Union[...]] - if isinstance(deserializer.args[0], list): - for sub_deserializer in deserializer.args[0]: - if _is_array_encoded_deserializer(sub_deserializer): - return sub_deserializer(obj) - - return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) - - -def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: - return sorted( - types, - key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), - ) - - -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches - annotation: typing.Any, - module: typing.Optional[str], - rf: typing.Optional["_RestField"] = None, -) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - if not annotation: - return None - - # is it a type alias? - if isinstance(annotation, str): - if module is not None: - annotation = _get_type_alias_type(module, annotation) - - # is it a forward ref / in quotes? - if isinstance(annotation, (str, typing.ForwardRef)): - try: - model_name = annotation.__forward_arg__ # type: ignore - except AttributeError: - model_name = annotation - if module is not None: - annotation = _get_model(module, model_name) # type: ignore - - try: - if module and _is_model(annotation): - if rf: - rf._is_model = True - - return functools.partial(_deserialize_model, annotation) # pyright: ignore - except Exception: - pass - - # is it a literal? - try: - if annotation.__origin__ is typing.Literal: # pyright: ignore - return None - except AttributeError: - pass - - # is it optional? - try: - if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore - if rf: - rf._is_optional = True - if len(annotation.__args__) <= 2: # pyright: ignore - if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_with_optional, if_obj_deserializer) - # the type is Optional[Union[...]], we need to remove the None type from the Union - annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore - return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) - except AttributeError: - pass - - # is it union? - if getattr(annotation, "__origin__", None) is typing.Union: - # initial ordering is we make `string` the last deserialization option, because it is often them most generic - deserializers = [ - _get_deserialize_callable_from_annotation(arg, module, rf) - for arg in _sorted_annotations(annotation.__args__) # pyright: ignore - ] - - return functools.partial(_deserialize_with_union, deserializers) - - try: - annotation_name = ( - annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore - ) - if annotation_name.lower() == "dict": - value_deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[1], module, rf # pyright: ignore - ) - - return functools.partial( - _deserialize_dict, - value_deserializer, - module, - ) - except (AttributeError, IndexError): - pass - try: - annotation_name = ( - annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore - ) - if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: - if len(annotation.__args__) > 1: # pyright: ignore - entry_deserializers = [ - _get_deserialize_callable_from_annotation(dt, module, rf) - for dt in annotation.__args__ # pyright: ignore - ] - return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) - deserializer = _get_deserialize_callable_from_annotation( - annotation.__args__[0], module, rf # pyright: ignore - ) - - return functools.partial(_deserialize_sequence, deserializer, module) - except (TypeError, IndexError, AttributeError, SyntaxError): - pass - - def _deserialize_default( - deserializer, - obj, - ): - if obj is None: - return obj - try: - return _deserialize_with_callable(deserializer, obj) - except Exception: - pass - return obj - - if get_deserializer(annotation, rf): - return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) - - return functools.partial(_deserialize_default, annotation) - - -def _deserialize_with_callable( - deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], - value: typing.Any, -): # pylint: disable=too-many-return-statements - try: - if value is None or isinstance(value, _Null): - return None - if isinstance(value, ET.Element): - if deserializer is str: - return value.text or "" - if deserializer is int: - return int(value.text) if value.text else None - if deserializer is float: - return float(value.text) if value.text else None - if deserializer is bool: - return value.text == "true" if value.text else None - if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): - return deserializer(value.text) if value.text else None - if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): - return deserializer(value.text) if value.text else None - if deserializer is None: - return value - if deserializer in [int, float, bool]: - return deserializer(value) - if isinstance(deserializer, CaseInsensitiveEnumMeta): - try: - return deserializer(value.text if isinstance(value, ET.Element) else value) - except ValueError: - # for unknown value, return raw value - return value.text if isinstance(value, ET.Element) else value - if isinstance(deserializer, type) and issubclass(deserializer, Model): - return deserializer._deserialize(value, []) - return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) - except Exception as e: - raise DeserializationError() from e - - -def _deserialize( - deserializer: typing.Any, - value: typing.Any, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - if isinstance(value, PipelineResponse): - value = value.http_response.json() - if rf is None and format: - rf = _RestField(format=format) - if not isinstance(deserializer, functools.partial): - deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) - return _deserialize_with_callable(deserializer, value) - - -def _failsafe_deserialize( - deserializer: typing.Any, - response: HttpResponse, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - try: - return _deserialize(deserializer, response.json(), module, rf, format) - except Exception: # pylint: disable=broad-except - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -def _failsafe_deserialize_xml( - deserializer: typing.Any, - response: HttpResponse, -) -> typing.Any: - try: - return _deserialize_xml(deserializer, response.text()) - except Exception: # pylint: disable=broad-except - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -# pylint: disable=too-many-instance-attributes -class _RestField: - def __init__( - self, - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - is_discriminator: bool = False, - visibility: typing.Optional[list[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, - xml: typing.Optional[dict[str, typing.Any]] = None, - deserializer: typing.Optional[typing.Callable] = None, - original_tsp_name: typing.Optional[str] = None, - ): - self._type = type - self._rest_name_input = name - self._module: typing.Optional[str] = None - self._is_discriminator = is_discriminator - self._visibility = visibility - self._is_model = False - self._is_optional = False - self._default = default - self._format = format - self._is_multipart_file_input = is_multipart_file_input - self._xml = xml if xml is not None else {} - self._deserializer = deserializer - self._original_tsp_name = original_tsp_name - - @property - def _class_type(self) -> typing.Any: - result = getattr(self._type, "args", [None])[0] - # type may be wrapped by nested functools.partial so we need to check for that - if isinstance(result, functools.partial): - return getattr(result, "args", [None])[0] - return result - - @property - def _rest_name(self) -> str: - if self._rest_name_input is None: - raise ValueError("Rest name was never set") - return self._rest_name_input - - def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin - # by this point, type and rest_name will have a value bc we default - # them in __new__ of the Model class - # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name, _UNSET) - if item is _UNSET: - # Field not set by user; return the client default if one exists, otherwise None - return self._default if self._default is not _UNSET else None - if item is None: - return item - if self._is_model: - return item - - # For mutable types, we want mutations to directly affect _data - # Check if we've already deserialized this value - cache_attr = f"_deserialized_{self._rest_name}" - if hasattr(obj, cache_attr): - # Return the value from _data directly (it's been deserialized in place) - return obj._data.get(self._rest_name) - - # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) - if self._deserializer: - deserialized = self._deserializer(item) - else: - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) - - # For mutable types, store the deserialized value back in _data - # so mutations directly affect _data - if isinstance(deserialized, (dict, list, set)): - obj._data[self._rest_name] = deserialized - object.__setattr__(obj, cache_attr, True) # Mark as deserialized - return deserialized - - return deserialized - - def __set__(self, obj: Model, value) -> None: - # Clear the cached deserialized object when setting a new value - cache_attr = f"_deserialized_{self._rest_name}" - if hasattr(obj, cache_attr): - object.__delattr__(obj, cache_attr) - - if value is None: - # we want to wipe out entries if users set attr to None - try: - obj.__delitem__(self._rest_name) - except KeyError: - pass - return - if self._is_model: - if not _is_model(value): - value = _deserialize(self._type, value) - obj.__setitem__(self._rest_name, value) - return - obj.__setitem__(self._rest_name, _serialize(value, self._format)) - - def _get_deserialize_callable_from_annotation( - self, annotation: typing.Any - ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - return _get_deserialize_callable_from_annotation(annotation, self._module, self) - - -def rest_field( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[list[str]] = None, - default: typing.Any = _UNSET, - format: typing.Optional[str] = None, - is_multipart_file_input: bool = False, - xml: typing.Optional[dict[str, typing.Any]] = None, - deserializer: typing.Optional[typing.Callable] = None, - original_tsp_name: typing.Optional[str] = None, -) -> typing.Any: - return _RestField( - name=name, - type=type, - visibility=visibility, - default=default, - format=format, - is_multipart_file_input=is_multipart_file_input, - xml=xml, - deserializer=deserializer, - original_tsp_name=original_tsp_name, - ) - - -def rest_discriminator( - *, - name: typing.Optional[str] = None, - type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[list[str]] = None, - xml: typing.Optional[dict[str, typing.Any]] = None, -) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) - - -def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: - """Serialize a model to XML. - - :param Model model: The model to serialize. - :param bool exclude_readonly: Whether to exclude readonly properties. - :returns: The XML representation of the model. - :rtype: str - """ - return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore - - -def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: - """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. - - :param dict meta: The metadata dictionary to extract namespace from. - :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. - :rtype: str or None - """ - ns = meta.get("ns") - if ns is None: - ns = meta.get("namespace") - return ns - - -def _resolve_xml_ns( - prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None -) -> typing.Optional[str]: - """Resolve XML namespace for a property, falling back to model namespace when appropriate. - - Checks the property metadata first; if no namespace is found and the model does not declare - an explicit prefix, falls back to the model-level namespace. - - :param dict prop_meta: The property metadata dictionary. - :param dict model_meta: The model metadata dictionary, used as fallback. - :returns: The resolved namespace string, or None. - :rtype: str or None - """ - ns = _get_xml_ns(prop_meta) - if ns is None and model_meta is not None and not model_meta.get("prefix"): - ns = _get_xml_ns(model_meta) - return ns - - -def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: - """Set an XML attribute on an element, handling namespace prefix registration. - - :param ET.Element element: The element to set the attribute on. - :param str name: The default attribute name (wire name). - :param any value: The attribute value. - :param dict prop_meta: The property metadata dictionary. - """ - xml_name = prop_meta.get("name", name) - _attr_ns = _get_xml_ns(prop_meta) - if _attr_ns: - _attr_prefix = prop_meta.get("prefix") - if _attr_prefix: - _safe_register_namespace(_attr_prefix, _attr_ns) - xml_name = "{" + _attr_ns + "}" + xml_name - element.set(xml_name, _get_primitive_type_value(value)) - - -def _get_element( - o: typing.Any, - exclude_readonly: bool = False, - parent_meta: typing.Optional[dict[str, typing.Any]] = None, - wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, list[ET.Element]]: - if _is_model(o): - model_meta = getattr(o, "_xml", {}) - - # if prop is a model, then use the prop element directly, else generate a wrapper of model - if wrapped_element is None: - # When serializing as an array item (parent_meta is set), check if the parent has an - # explicit itemsName. This ensures correct element names for unwrapped arrays (where - # the element tag is the property/items name, not the model type name). - _items_name = parent_meta.get("itemsName") if parent_meta is not None else None - element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) - _model_ns = _get_xml_ns(model_meta) - wrapped_element = _create_xml_element( - element_name, - model_meta.get("prefix"), - _model_ns, - ) - - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - - for k, v in o.items(): - # do not serialize readonly properties - if exclude_readonly and k in readonly_props: - continue - - prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) - if prop_rest_field: - prop_meta = getattr(prop_rest_field, "_xml").copy() - # use the wire name as xml name if no specific name is set - if prop_meta.get("name") is None: - prop_meta["name"] = k - else: - # additional properties will not have rest field, use the wire name as xml name - prop_meta = {"name": k} - - # Propagate model namespace to properties only for old-style "ns"-keyed models. - # DPG-generated models use the "namespace" key and explicitly declare namespace on - # each property that needs it, so propagation is intentionally skipped for them. - if prop_meta.get("ns") is None and model_meta.get("ns"): - prop_meta["ns"] = model_meta.get("ns") - prop_meta["prefix"] = model_meta.get("prefix") - - if prop_meta.get("unwrapped", False): - # unwrapped could only set on array - wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) - elif prop_meta.get("text", False): - # text could only set on primitive type - wrapped_element.text = _get_primitive_type_value(v) - elif prop_meta.get("attribute", False): - _set_xml_attribute(wrapped_element, k, v, prop_meta) - else: - # other wrapped prop element - wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) - return wrapped_element - if isinstance(o, list): - return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore - if isinstance(o, dict): - result = [] - _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None - for k, v in o.items(): - result.append( - _get_wrapped_element( - v, - exclude_readonly, - { - "name": k, - "ns": _dict_ns, - "prefix": parent_meta.get("prefix") if parent_meta else None, - }, - ) - ) - return result - - # primitive case need to create element based on parent_meta - if parent_meta: - _items_ns = parent_meta.get("itemsNs") - if _items_ns is None: - _items_ns = _get_xml_ns(parent_meta) - return _get_wrapped_element( - o, - exclude_readonly, - { - "name": parent_meta.get("itemsName", parent_meta.get("name")), - "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": _items_ns, - }, - ) - - raise ValueError("Could not serialize value into xml: " + o) - - -def _get_wrapped_element( - v: typing.Any, - exclude_readonly: bool, - meta: typing.Optional[dict[str, typing.Any]], -) -> ET.Element: - _meta_ns = _get_xml_ns(meta) if meta else None - wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns - ) - if isinstance(v, (dict, list)): - wrapped_element.extend(_get_element(v, exclude_readonly, meta)) - elif _is_model(v): - _get_element(v, exclude_readonly, meta, wrapped_element) - else: - wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element # type: ignore[no-any-return] - - -def _get_primitive_type_value(v) -> str: - if v is True: - return "true" - if v is False: - return "false" - if isinstance(v, _Null): - return "" - return str(v) - - -def _safe_register_namespace(prefix: str, ns: str) -> None: - """Register an XML namespace prefix, handling reserved prefix patterns. - - Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for - auto-generated prefixes, causing register_namespace to raise ValueError. - Falls back to directly registering in the internal namespace map. - - :param str prefix: The namespace prefix to register. - :param str ns: The namespace URI. - """ - try: - ET.register_namespace(prefix, ns) - except ValueError: - _ns_map = getattr(ET, "_namespace_map", None) - if _ns_map is not None: - _ns_map[ns] = prefix - - -def _create_xml_element( - tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None -) -> ET.Element: - if prefix and ns: - _safe_register_namespace(prefix, ns) - if ns: - return ET.Element("{" + ns + "}" + tag) - return ET.Element(tag) - - -def _deserialize_xml( - deserializer: typing.Any, - value: str, -) -> typing.Any: - element = ET.fromstring(value) # nosec - if _is_model(deserializer): - return deserializer._deserialize(element, []) - return _deserialize(deserializer, element) - - -def _convert_element(e: ET.Element): - # dict case - if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: dict[str, typing.Any] = {} - for child in e: - if dict_result.get(child.tag) is not None: - if isinstance(dict_result[child.tag], list): - dict_result[child.tag].append(_convert_element(child)) - else: - dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] - else: - dict_result[child.tag] = _convert_element(child) - dict_result.update(e.attrib) - return dict_result - # array case - if len(e) > 0: - array_result: list[typing.Any] = [] - for child in e: - array_result.append(_convert_element(child)) - return array_result - # primitive case - return e.text diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py index 77497ed77c93..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py @@ -7,13 +7,9 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, Awaitable -from azure.core.credentials_async import AsyncTokenCredential -from azure.core.rest import AsyncHttpResponse, HttpRequest - -__all__: list[str] = [] +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): @@ -23,16 +19,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - from ._client import DeviceUpdateClient - - generated_init = DeviceUpdateClient.__init__ - generated_send_request = DeviceUpdateClient.send_request - - def __init__(self, endpoint: str, instance_id: str, credential: AsyncTokenCredential, **kwargs: Any) -> None: - generated_init(self, endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) - - def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: - return generated_send_request(self, request, **kwargs) - - setattr(DeviceUpdateClient, "__init__", __init__) - setattr(DeviceUpdateClient, "send_request", send_request) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py index 72351924fada..2ad5ff56ba42 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py @@ -8,7 +8,6 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -import json from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -33,8 +32,6 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models, types as _types -from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ...operations._operations import ( build_device_management_create_or_update_deployment_request, @@ -90,6 +87,7 @@ ) from .._configuration import DeviceUpdateClientConfiguration +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] @@ -114,21 +112,73 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_updates( self, *, search: Optional[str] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Update"]: + ) -> AsyncItemPaged[JSON]: """Get a list of all updates that have been imported to Device Update for IoT Hub. :keyword search: Request updates matching a free-text search expression. Default value is None. :paramtype search: str :keyword filter: Optional to filter updates by isDeployable property. Default value is None. :paramtype filter: str - :return: An iterator like instance of Update - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.Update] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "compatibility": [ + {} + ], + "createdDateTime": "2020-02-20 00:00:00", + "importedDateTime": "2020-02-20 00:00:00", + "manifestVersion": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "etag": "str", + "friendlyName": "str", + "installedCriteria": "str", + "instructions": { + "steps": [ + { + "description": "str", + "files": [ + "str" + ], + "handler": "str", + "handlerProperties": { + "str": {} + }, + "type": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + } + } + ] + }, + "isDeployable": bool, + "referencedBy": [ + { + "name": "str", + "provider": "str", + "version": "str" + } + ], + "scanResult": "str", + "updateType": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Update]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -179,10 +229,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Update], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -198,20 +245,14 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) async def _import_update_initial( - self, - update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], - **kwargs: Any + self, update_to_import: Union[list[JSON], IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -228,16 +269,18 @@ async def _import_update_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" + _json = None _content = None if isinstance(update_to_import, (IOBase, bytes)): _content = update_to_import else: - _content = json.dumps(update_to_import, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = update_to_import _request = build_device_update_import_update_request( instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -261,11 +304,7 @@ async def _import_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} if response.status_code == 202: @@ -276,17 +315,13 @@ async def _import_update_initial( deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(AsyncIterator[bytes], deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(AsyncIterator[bytes], deserialized) # type: ignore @overload async def begin_import_update( - self, - update_to_import: list[_models.ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any + self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. @@ -295,37 +330,36 @@ async def begin_import_update( `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for details). Required. - :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] + :type update_to_import: list[JSON] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - async def begin_import_update( - self, - update_to_import: list[_types.ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Import new update version. This is a long-running-operation; use Operation-Location response - header value to check for operation status. + Example: + .. code-block:: python - :param update_to_import: The update to be imported (see schema - `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json - `_ for - details). Required. - :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + # JSON input template you can fill out and use as your body input. + update_to_import = [ + { + "importManifest": { + "hashes": { + "str": "str" + }, + "sizeInBytes": 0, + "url": "str" + }, + "files": [ + { + "filename": "str", + "url": "str" + } + ], + "friendlyName": "str" + } + ] """ @overload @@ -350,9 +384,7 @@ async def begin_import_update( @distributed_trace_async async def begin_import_update( - self, - update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], - **kwargs: Any + self, update_to_import: Union[list[JSON], IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. @@ -360,9 +392,8 @@ async def begin_import_update( :param update_to_import: The update to be imported (see schema `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for - details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. - :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or - list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] + details). Is either a [JSON] type or a IO[bytes] type. Required. + :type update_to_import: list[JSON] or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -423,7 +454,7 @@ async def get_update( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.Update: + ) -> JSON: """Get a specific update version. :param provider: Update provider. Required. @@ -437,9 +468,61 @@ async def get_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Update + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "compatibility": [ + {} + ], + "createdDateTime": "2020-02-20 00:00:00", + "importedDateTime": "2020-02-20 00:00:00", + "manifestVersion": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "etag": "str", + "friendlyName": "str", + "installedCriteria": "str", + "instructions": { + "steps": [ + { + "description": "str", + "files": [ + "str" + ], + "handler": "str", + "handlerProperties": { + "str": {} + }, + "type": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + } + } + ] + }, + "isDeployable": bool, + "referencedBy": [ + { + "name": "str", + "provider": "str", + "version": "str" + } + ], + "scanResult": "str", + "updateType": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -458,7 +541,7 @@ async def get_update( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Update] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_update_get_update_request( provider=provider, @@ -491,21 +574,20 @@ async def get_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Update, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore async def _delete_update_initial( self, provider: str, name: str, version: str, **kwargs: Any @@ -551,11 +633,7 @@ async def _delete_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) @@ -563,9 +641,9 @@ async def _delete_update_initial( deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(AsyncIterator[bytes], deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(AsyncIterator[bytes], deserialized) # type: ignore @distributed_trace_async async def begin_delete_update(self, provider: str, name: str, version: str, **kwargs: Any) -> AsyncLROPoller[None]: @@ -635,6 +713,12 @@ def list_providers(self, **kwargs: Any) -> AsyncItemPaged[str]: :return: An iterator like instance of str :rtype: ~azure.core.async_paging.AsyncItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -688,10 +772,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -707,11 +788,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -726,6 +803,12 @@ def list_names(self, provider: str, **kwargs: Any) -> AsyncItemPaged[str]: :return: An iterator like instance of str :rtype: ~azure.core.async_paging.AsyncItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -780,10 +863,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -799,11 +879,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -824,6 +900,12 @@ def list_versions( :return: An iterator like instance of str :rtype: ~azure.core.async_paging.AsyncItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -880,10 +962,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -899,11 +978,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -922,6 +997,12 @@ def list_files(self, provider: str, name: str, version: str, **kwargs: Any) -> A :return: An iterator like instance of str :rtype: ~azure.core.async_paging.AsyncItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -978,10 +1059,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -997,11 +1075,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -1018,7 +1092,7 @@ async def get_file( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.UpdateFile: + ) -> JSON: """Get a specific update file from the version. :param provider: Update provider. Required. @@ -1034,9 +1108,47 @@ async def get_file( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: UpdateFile. The UpdateFile is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateFile + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "fileId": "str", + "fileName": "str", + "hashes": { + "str": "str" + }, + "sizeInBytes": 0, + "downloadHandler": { + "id": "str" + }, + "etag": "str", + "mimeType": "str", + "properties": { + "str": "str" + }, + "relatedFiles": [ + { + "fileName": "str", + "hashes": { + "str": "str" + }, + "sizeInBytes": 0, + "mimeType": "str", + "properties": { + "str": "str" + }, + "scanDetails": "str", + "scanResult": "str" + } + ], + "scanDetails": "str", + "scanResult": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1055,7 +1167,7 @@ async def get_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateFile] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_update_get_file_request( provider=provider, @@ -1089,26 +1201,25 @@ async def get_file( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateFile, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_operation_statuses( self, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.UpdateOperation"]: + ) -> AsyncItemPaged[JSON]: """Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete operations are not returned by this API version. @@ -1119,14 +1230,52 @@ def list_operation_statuses( from a collection. The service returns the number of available items up to but not greater than the specified value n. Default value is None. :paramtype top: int - :return: An iterator like instance of UpdateOperation - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.UpdateOperation] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "resourceLocation": "str", + "traceId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.UpdateOperation]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1177,10 +1326,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.UpdateOperation], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1196,11 +1342,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -1214,7 +1356,7 @@ async def get_operation_status( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.UpdateOperation: + ) -> JSON: """Retrieve operation status. :param operation_id: Operation identifier. Required. @@ -1224,9 +1366,47 @@ async def get_operation_status( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: UpdateOperation. The UpdateOperation is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateOperation + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "resourceLocation": "str", + "traceId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1245,7 +1425,7 @@ async def get_operation_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateOperation] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_update_get_operation_status_request( operation_id=operation_id, @@ -1276,11 +1456,7 @@ async def get_operation_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After")) @@ -1288,12 +1464,15 @@ async def get_operation_status( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateOperation, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore class DeviceManagementOperations: # pylint: disable=too-many-public-methods @@ -1314,9 +1493,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_device_classes( - self, *, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.DeviceClass"]: + def list_device_classes(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged[JSON]: """Gets a list of all device classes (sets of devices compatible with the same updates based on the model Id and compat properties reported in the Device Update PnP interface in IoT Hub) for all devices connected to Device Update for IoT Hub. @@ -1324,14 +1501,41 @@ def list_device_classes( :keyword filter: Restricts the set of device classes returned. You can filter on friendly name. Default value is None. :paramtype filter: str - :return: An iterator like instance of DeviceClass - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.DeviceClass] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceClass]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1381,10 +1585,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceClass], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1400,25 +1601,48 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_device_class(self, device_class_id: str, **kwargs: Any) -> _models.DeviceClass: + async def get_device_class(self, device_class_id: str, **kwargs: Any) -> JSON: """Gets the properties of a device class. :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1431,7 +1655,7 @@ async def get_device_class(self, device_class_id: str, **kwargs: Any) -> _models _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClass] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_request( device_class_id=device_class_id, @@ -1460,31 +1684,30 @@ async def get_device_class(self, device_class_id: str, **kwargs: Any) -> _models except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClass, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @overload async def update_device_class( self, device_class_id: str, - device_class_patch: _models.PatchBody, + device_class_patch: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.DeviceClass: + ) -> JSON: """Update device class details. :param device_class_id: Device class identifier. Required. @@ -1492,38 +1715,45 @@ async def update_device_class( :param device_class_patch: The device class json merge patch body. Currently only supports patching friendlyName. Required. - :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody + :type device_class_patch: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - async def update_device_class( - self, - device_class_id: str, - device_class_patch: _types.PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.DeviceClass: - """Update device class details. + Example: + .. code-block:: python - :param device_class_id: Device class identifier. Required. - :type device_class_id: str - :param device_class_patch: The device class json merge patch body. Currently only supports - patching - friendlyName. Required. - :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass - :raises ~azure.core.exceptions.HttpResponseError: + # JSON input template you can fill out and use as your body input. + device_class_patch = { + "friendlyName": "str" + } + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ @overload @@ -1534,7 +1764,7 @@ async def update_device_class( *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.DeviceClass: + ) -> JSON: """Update device class details. :param device_class_id: Device class identifier. Required. @@ -1546,30 +1776,85 @@ async def update_device_class( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ @distributed_trace_async async def update_device_class( - self, - device_class_id: str, - device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], - **kwargs: Any - ) -> _models.DeviceClass: + self, device_class_id: str, device_class_patch: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: """Update device class details. :param device_class_id: Device class identifier. Required. :type device_class_id: str :param device_class_patch: The device class json merge patch body. Currently only supports patching - friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. - :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or - ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + friendlyName. Is either a JSON type or a IO[bytes] type. Required. + :type device_class_patch: JSON or IO[bytes] + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + device_class_patch = { + "friendlyName": "str" + } + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1583,20 +1868,22 @@ async def update_device_class( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeviceClass] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/merge-patch+json" + _json = None _content = None if isinstance(device_class_patch, (IOBase, bytes)): _content = device_class_patch else: - _content = json.dumps(device_class_patch, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = device_class_patch _request = build_device_management_update_device_class_request( device_class_id=device_class_id, instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -1621,21 +1908,20 @@ async def update_device_class( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClass, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_device_class(self, device_class_id: str, **kwargs: Any) -> None: @@ -1686,11 +1972,7 @@ async def delete_device_class(self, device_class_id: str, **kwargs: Any) -> None if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -1698,19 +1980,33 @@ async def delete_device_class(self, device_class_id: str, **kwargs: Any) -> None @distributed_trace def list_installable_updates_for_device_class( # pylint: disable=name-too-long self, device_class_id: str, **kwargs: Any - ) -> AsyncItemPaged["_models.UpdateInfo"]: + ) -> AsyncItemPaged[JSON]: """Gets a list of installable updates for a device class. :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: An iterator like instance of UpdateInfo - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.UpdateInfo] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.UpdateInfo]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1760,10 +2056,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.UpdateInfo], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1779,18 +2072,14 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_devices(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.Device"]: + def list_devices(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged[JSON]: """Gets a list of devices connected to Device Update for IoT Hub. :keyword filter: Restricts the set of devices returned. You can filter on GroupId, @@ -1798,14 +2087,68 @@ def list_devices(self, *, filter: Optional[str] = None, **kwargs: Any) -> AsyncI query for devices with no deployment status (that have never been deployed to). Default value is None. :paramtype filter: str - :return: An iterator like instance of Device - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.Device] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceId": "str", + "onLatestUpdate": bool, + "deploymentStatus": "str", + "groupId": "str", + "installedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastAttemptedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastDeploymentId": "str", + "lastInstallResult": { + "extendedResultCode": 0, + "resultCode": 0, + "resultDetails": "str", + "stepResults": [ + { + "extendedResultCode": 0, + "resultCode": 0, + "description": "str", + "resultDetails": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + ] + }, + "moduleId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Device]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1855,10 +2198,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Device], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1874,19 +2214,13 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) - async def _import_devices_initial( - self, import_type: Union[str, _models.ImportType], **kwargs: Any - ) -> AsyncIterator[bytes]: + async def _import_devices_initial(self, import_type: str, **kwargs: Any) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1901,13 +2235,13 @@ async def _import_devices_initial( content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _content = json.dumps(import_type, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = import_type _request = build_device_management_import_devices_request( instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, - content=_content, + json=_json, headers=_headers, params=_params, ) @@ -1930,11 +2264,7 @@ async def _import_devices_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) @@ -1942,20 +2272,18 @@ async def _import_devices_initial( deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(AsyncIterator[bytes], deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(AsyncIterator[bytes], deserialized) # type: ignore @distributed_trace_async - async def begin_import_devices( - self, import_type: Union[str, _models.ImportType], **kwargs: Any - ) -> AsyncLROPoller[None]: + async def begin_import_devices(self, import_type: str, **kwargs: Any) -> AsyncLROPoller[None]: """Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header value to check for operation status. :param import_type: The types of devices to import. Known values are: "Devices", "Modules", and "All". Required. - :type import_type: str or ~azure.iot.deviceupdate.models.ImportType + :type import_type: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2007,15 +2335,69 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def get_device(self, device_id: str, **kwargs: Any) -> _models.Device: + async def get_device(self, device_id: str, **kwargs: Any) -> JSON: """Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. :param device_id: Device identifier in Azure IoT Hub. Required. :type device_id: str - :return: Device. The Device is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Device + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceId": "str", + "onLatestUpdate": bool, + "deploymentStatus": "str", + "groupId": "str", + "installedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastAttemptedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastDeploymentId": "str", + "lastInstallResult": { + "extendedResultCode": 0, + "resultCode": 0, + "resultDetails": "str", + "stepResults": [ + { + "extendedResultCode": 0, + "resultCode": 0, + "description": "str", + "resultDetails": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + ] + }, + "moduleId": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2028,7 +2410,7 @@ async def get_device(self, device_id: str, **kwargs: Any) -> _models.Device: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Device] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_request( device_id=device_id, @@ -2057,24 +2439,23 @@ async def get_device(self, device_id: str, **kwargs: Any) -> _models.Device: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Device, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) -> _models.Device: + async def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) -> JSON: """Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub. @@ -2082,9 +2463,63 @@ async def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) :type device_id: str :param module_id: Device module identifier in Azure IoT Hub. Required. :type module_id: str - :return: Device. The Device is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Device + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceId": "str", + "onLatestUpdate": bool, + "deploymentStatus": "str", + "groupId": "str", + "installedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastAttemptedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastDeploymentId": "str", + "lastInstallResult": { + "extendedResultCode": 0, + "resultCode": 0, + "resultDetails": "str", + "stepResults": [ + { + "extendedResultCode": 0, + "resultCode": 0, + "description": "str", + "resultDetails": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + ] + }, + "moduleId": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2097,7 +2532,7 @@ async def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Device] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_module_request( device_id=device_id, @@ -2127,30 +2562,40 @@ async def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Device, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def get_update_compliance(self, **kwargs: Any) -> _models.UpdateCompliance: + async def get_update_compliance(self, **kwargs: Any) -> JSON: """Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates. - :return: UpdateCompliance. The UpdateCompliance is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateCompliance + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "newUpdatesAvailableDeviceCount": 0, + "onLatestUpdateDeviceCount": 0, + "totalDeviceCount": 0, + "updatesInProgressDeviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2163,7 +2608,7 @@ async def get_update_compliance(self, **kwargs: Any) -> _models.UpdateCompliance _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateCompliance] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_update_compliance_request( instance_id=self._config.instance_id, @@ -2191,38 +2636,54 @@ async def get_update_compliance(self, **kwargs: Any) -> _models.UpdateCompliance except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateCompliance, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_groups(self, *, order_by: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.Group"]: + def list_groups(self, *, order_by: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged[JSON]: """Gets a list of all device groups. The $default group will always be returned first. :keyword order_by: Orders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. Default value is None. :paramtype order_by: str - :return: An iterator like instance of Group - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.Group] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "groupId": "str", + "groupType": "str", + "deployments": [ + "str" + ], + "deviceCount": 0, + "subgroupsWithNewUpdatesAvailableCount": 0, + "subgroupsWithOnLatestUpdateCount": 0, + "subgroupsWithUpdatesInProgressCount": 0 + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Group]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2272,10 +2733,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Group], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2291,25 +2749,38 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_group(self, group_id: str, **kwargs: Any) -> _models.Group: + async def get_group(self, group_id: str, **kwargs: Any) -> JSON: """Gets the device group properties. :param group_id: Group identifier. Required. :type group_id: str - :return: Group. The Group is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Group + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "groupId": "str", + "groupType": "str", + "deployments": [ + "str" + ], + "deviceCount": 0, + "subgroupsWithNewUpdatesAvailableCount": 0, + "subgroupsWithOnLatestUpdateCount": 0, + "subgroupsWithUpdatesInProgressCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2322,7 +2793,7 @@ async def get_group(self, group_id: str, **kwargs: Any) -> _models.Group: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Group] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_group_request( group_id=group_id, @@ -2351,21 +2822,20 @@ async def get_group(self, group_id: str, **kwargs: Any) -> _models.Group: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Group, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_group(self, group_id: str, **kwargs: Any) -> None: @@ -2416,25 +2886,32 @@ async def delete_group(self, group_id: str, **kwargs: Any) -> None: if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> _models.UpdateCompliance: + async def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> JSON: """Get device group update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update. :param group_id: Group identifier. Required. :type group_id: str - :return: UpdateCompliance. The UpdateCompliance is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateCompliance + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "newUpdatesAvailableDeviceCount": 0, + "onLatestUpdateDeviceCount": 0, + "totalDeviceCount": 0, + "updatesInProgressDeviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2447,7 +2924,7 @@ async def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateCompliance] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_update_compliance_for_group_request( group_id=group_id, @@ -2476,40 +2953,55 @@ async def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateCompliance, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_best_updates_for_group( - self, group_id: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DeviceClassSubgroupUpdatableDevices"]: + def list_best_updates_for_group(self, group_id: str, **kwargs: Any) -> AsyncItemPaged[JSON]: """Get the best available updates for a device group and a count of how many devices need each update. :param group_id: Group identifier. Required. :type group_id: str - :return: An iterator like instance of DeviceClassSubgroupUpdatableDevices - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceCount": 0, + "groupId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceClassSubgroupUpdatableDevices]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2559,10 +3051,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceClassSubgroupUpdatableDevices], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2578,11 +3067,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -2591,7 +3076,7 @@ async def get_next(next_link=None): @distributed_trace def list_deployments_for_group( self, group_id: str, *, order_by: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Deployment"]: + ) -> AsyncItemPaged[JSON]: """Gets a list of deployments for a device group. :param group_id: Group identifier. Required. @@ -2599,14 +3084,55 @@ def list_deployments_for_group( :keyword order_by: Orders the set of deployments returned. You can order by start date. Default value is None. :paramtype order_by: str - :return: An iterator like instance of Deployment - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.Deployment] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2657,10 +3183,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Deployment], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2676,27 +3199,64 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.Deployment: + async def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Gets the deployment properties. :param group_id: Group identifier. Required. :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2709,7 +3269,7 @@ async def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_deployment_request( group_id=group_id, @@ -2739,32 +3299,31 @@ async def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @overload async def create_or_update_deployment( self, group_id: str, deployment_id: str, - deployment: _models.Deployment, + deployment: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Deployment: + ) -> JSON: """Creates or updates a deployment. :param group_id: Group identifier. Required. @@ -2772,39 +3331,92 @@ async def create_or_update_deployment( :param deployment_id: Deployment identifier. Required. :type deployment_id: str :param deployment: The deployment properties. Required. - :type deployment: ~azure.iot.deviceupdate.models.Deployment + :type deployment: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - async def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: _types.Deployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Deployment: - """Creates or updates a deployment. + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + deployment = { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } - :param group_id: Group identifier. Required. - :type group_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :param deployment: The deployment properties. Required. - :type deployment: ~azure.iot.deviceupdate.types.Deployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment - :raises ~azure.core.exceptions.HttpResponseError: + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ @overload @@ -2816,7 +3428,7 @@ async def create_or_update_deployment( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Deployment: + ) -> JSON: """Creates or updates a deployment. :param group_id: Group identifier. Required. @@ -2828,32 +3440,147 @@ async def create_or_update_deployment( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ @distributed_trace_async async def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], - **kwargs: Any - ) -> _models.Deployment: + self, group_id: str, deployment_id: str, deployment: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: """Creates or updates a deployment. :param group_id: Group identifier. Required. :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. + :param deployment: The deployment properties. Is either a JSON type or a IO[bytes] type. Required. - :type deployment: ~azure.iot.deviceupdate.models.Deployment or - ~azure.iot.deviceupdate.types.Deployment or IO[bytes] - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :type deployment: JSON or IO[bytes] + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + deployment = { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2867,14 +3594,15 @@ async def create_or_update_deployment( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" + _json = None _content = None if isinstance(deployment, (IOBase, bytes)): _content = deployment else: - _content = json.dumps(deployment, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = deployment _request = build_device_management_create_or_update_deployment_request( group_id=group_id, @@ -2882,6 +3610,7 @@ async def create_or_update_deployment( instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -2906,21 +3635,20 @@ async def create_or_update_deployment( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> None: @@ -2969,17 +3697,13 @@ async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: A if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: + async def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. @@ -2987,9 +3711,60 @@ async def get_deployment_status(self, group_id: str, deployment_id: str, **kwarg :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: DeploymentStatus. The DeploymentStatus is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeploymentStatus + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentState": "str", + "groupId": "str", + "subgroupStatus": [ + { + "deploymentState": "str", + "deviceClassId": "str", + "groupId": "str", + "devicesCanceledCount": 0, + "devicesCompletedFailedCount": 0, + "devicesCompletedSucceededCount": 0, + "devicesInProgressCount": 0, + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "totalDevices": 0 + } + ], + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3002,7 +3777,7 @@ async def get_deployment_status(self, group_id: str, deployment_id: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeploymentStatus] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_deployment_status_request( group_id=group_id, @@ -3032,26 +3807,25 @@ async def get_deployment_status(self, group_id: str, deployment_id: str, **kwarg except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeploymentStatus, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_device_class_subgroups_for_group( self, group_id: str, *, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.DeviceClassSubgroup"]: + ) -> AsyncItemPaged[JSON]: """Get the device class subgroups for the group. A device class subgroup is the set of devices within the group that share the same device class. All devices within the same device class are compatible with the same updates. @@ -3062,15 +3836,26 @@ def list_device_class_subgroups_for_group( properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2'). Default value is None. :paramtype filter: str - :return: An iterator like instance of DeviceClassSubgroup - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.DeviceClassSubgroup] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "deviceClassId": "str", + "groupId": "str", + "deploymentId": "str", + "deviceCount": 0 + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceClassSubgroup]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3121,10 +3906,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceClassSubgroup], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3140,20 +3922,14 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_device_class_subgroup( - self, group_id: str, device_class_id: str, **kwargs: Any - ) -> _models.DeviceClassSubgroup: + async def get_device_class_subgroup(self, group_id: str, device_class_id: str, **kwargs: Any) -> JSON: """Gets device class subgroup details. A device class subgroup is the set of devices within the group that share the same device class. All devices within the same device class are compatible with the same updates. @@ -3162,9 +3938,21 @@ async def get_device_class_subgroup( :type group_id: str :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: DeviceClassSubgroup. The DeviceClassSubgroup is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClassSubgroup + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "deviceClassId": "str", + "groupId": "str", + "deploymentId": "str", + "deviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3177,7 +3965,7 @@ async def get_device_class_subgroup( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClassSubgroup] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_subgroup_request( group_id=group_id, @@ -3207,21 +3995,20 @@ async def get_device_class_subgroup( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClassSubgroup, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_device_class_subgroup(self, group_id: str, device_class_id: str, **kwargs: Any) -> None: @@ -3275,11 +4062,7 @@ async def delete_device_class_subgroup(self, group_id: str, device_class_id: str if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -3287,7 +4070,7 @@ async def delete_device_class_subgroup(self, group_id: str, device_class_id: str @distributed_trace_async async def get_device_class_subgroup_update_compliance( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, **kwargs: Any - ) -> _models.UpdateCompliance: + ) -> JSON: """Get device class subgroup update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update. @@ -3296,9 +4079,20 @@ async def get_device_class_subgroup_update_compliance( # pylint: disable=name-t :type group_id: str :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: UpdateCompliance. The UpdateCompliance is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateCompliance + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "newUpdatesAvailableDeviceCount": 0, + "onLatestUpdateDeviceCount": 0, + "totalDeviceCount": 0, + "updatesInProgressDeviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3311,7 +4105,7 @@ async def get_device_class_subgroup_update_compliance( # pylint: disable=name-t _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateCompliance] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_subgroup_update_compliance_request( group_id=group_id, @@ -3341,26 +4135,25 @@ async def get_device_class_subgroup_update_compliance( # pylint: disable=name-t except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateCompliance, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_best_updates_for_device_class_subgroup( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, **kwargs: Any - ) -> _models.DeviceClassSubgroupUpdatableDevices: + ) -> JSON: """Get the best available update for a device class subgroup and a count of how many devices need this update. @@ -3368,10 +4161,28 @@ async def get_best_updates_for_device_class_subgroup( # pylint: disable=name-to :type group_id: str :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: DeviceClassSubgroupUpdatableDevices. The DeviceClassSubgroupUpdatableDevices is - compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceCount": 0, + "groupId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3384,7 +4195,7 @@ async def get_best_updates_for_device_class_subgroup( # pylint: disable=name-to _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClassSubgroupUpdatableDevices] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_best_updates_for_device_class_subgroup_request( group_id=group_id, @@ -3414,26 +4225,25 @@ async def get_best_updates_for_device_class_subgroup( # pylint: disable=name-to except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClassSubgroupUpdatableDevices, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_deployments_for_device_class_subgroup( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, *, order_by: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Deployment"]: + ) -> AsyncItemPaged[JSON]: """Gets a list of deployments for a device class subgroup. :param group_id: Group identifier. Required. @@ -3443,14 +4253,55 @@ def list_deployments_for_device_class_subgroup( # pylint: disable=name-too-long :keyword order_by: Orders the set of deployments returned. You can order by start date. Default value is None. :paramtype order_by: str - :return: An iterator like instance of Deployment - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.Deployment] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3502,10 +4353,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Deployment], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3521,11 +4369,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -3534,7 +4378,7 @@ async def get_next(next_link=None): @distributed_trace_async async def get_deployment_for_device_class_subgroup( self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.Deployment: + ) -> JSON: """Gets the deployment properties. :param group_id: Group identifier. Required. @@ -3543,9 +4387,50 @@ async def get_deployment_for_device_class_subgroup( :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3558,7 +4443,7 @@ async def get_deployment_for_device_class_subgroup( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_deployment_for_device_class_subgroup_request( group_id=group_id, @@ -3589,21 +4474,20 @@ async def get_deployment_for_device_class_subgroup( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-too-long @@ -3657,19 +4541,13 @@ async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-t if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def stop_deployment( - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.Deployment: + async def stop_deployment(self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Stops a deployment. :param group_id: Group identifier. Required. @@ -3678,9 +4556,50 @@ async def stop_deployment( :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3693,7 +4612,7 @@ async def stop_deployment( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_stop_deployment_request( group_id=group_id, @@ -3724,26 +4643,23 @@ async def stop_deployment( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def retry_deployment( - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.Deployment: + async def retry_deployment(self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Retries a deployment with failed devices. :param group_id: Group identifier. Required. @@ -3752,9 +4668,50 @@ async def retry_deployment( :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3767,7 +4724,7 @@ async def retry_deployment( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_retry_deployment_request( group_id=group_id, @@ -3798,26 +4755,25 @@ async def retry_deployment( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async async def get_device_class_subgroup_deployment_status( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.DeviceClassSubgroupDeploymentStatus: + ) -> JSON: """Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. @@ -3827,10 +4783,39 @@ async def get_device_class_subgroup_deployment_status( # pylint: disable=name-t :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: DeviceClassSubgroupDeploymentStatus. The DeviceClassSubgroupDeploymentStatus is - compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentState": "str", + "deviceClassId": "str", + "groupId": "str", + "devicesCanceledCount": 0, + "devicesCompletedFailedCount": 0, + "devicesCompletedSucceededCount": 0, + "devicesInProgressCount": 0, + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "totalDevices": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3843,7 +4828,7 @@ async def get_device_class_subgroup_deployment_status( # pylint: disable=name-t _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClassSubgroupDeploymentStatus] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_subgroup_deployment_status_request( group_id=group_id, @@ -3874,26 +4859,25 @@ async def get_device_class_subgroup_deployment_status( # pylint: disable=name-t except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClassSubgroupDeploymentStatus, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_device_states_for_device_class_subgroup_deployment( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, deployment_id: str, *, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.DeploymentDeviceState"]: + ) -> AsyncItemPaged[JSON]: """Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. @@ -3906,15 +4890,26 @@ def list_device_states_for_device_class_subgroup_deployment( # pylint: disable= :keyword filter: Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState. Default value is None. :paramtype filter: str - :return: An iterator like instance of DeploymentDeviceState - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.DeploymentDeviceState] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceId": "str", + "deviceState": "str", + "movedOnToNewDeployment": bool, + "retryCount": 0, + "moduleId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeploymentDeviceState]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3967,10 +4962,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeploymentDeviceState], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3986,11 +4978,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -4004,7 +4992,7 @@ async def get_operation_status( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.DeviceOperation: + ) -> JSON: """Retrieve operation status. :param operation_id: Operation identifier. Required. @@ -4014,9 +5002,37 @@ async def get_operation_status( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: DeviceOperation. The DeviceOperation is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceOperation + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "traceId": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4035,7 +5051,7 @@ async def get_operation_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceOperation] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_operation_status_request( operation_id=operation_id, @@ -4066,11 +5082,7 @@ async def get_operation_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After")) @@ -4078,17 +5090,20 @@ async def get_operation_status( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceOperation, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_operation_statuses( self, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.DeviceOperation"]: + ) -> AsyncItemPaged[JSON]: """Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. @@ -4099,14 +5114,42 @@ def list_operation_statuses( from a collection. The service returns the number of available items up to but not greater than the specified value n. Default value is None. :paramtype top: int - :return: An iterator like instance of DeviceOperation - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.DeviceOperation] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "traceId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceOperation]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4157,10 +5200,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceOperation], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4176,11 +5216,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -4188,48 +5224,53 @@ async def get_next(next_link=None): @overload async def start_log_collection( - self, - log_collection_id: str, - log_collection: _models.LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogCollection: + self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str :param log_collection: The log collection properties. Required. - :type log_collection: ~azure.iot.deviceupdate.models.LogCollection + :type log_collection: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - async def start_log_collection( - self, - log_collection_id: str, - log_collection: _types.LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogCollection: - """Start the device diagnostics log collection on specified devices. + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + log_collection = { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } - :param log_collection_id: Log collection identifier. Required. - :type log_collection_id: str - :param log_collection: The log collection properties. Required. - :type log_collection: ~azure.iot.deviceupdate.types.LogCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection - :raises ~azure.core.exceptions.HttpResponseError: + # response body for status code(s): 201 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ @overload @@ -4240,7 +5281,7 @@ async def start_log_collection( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.LogCollection: + ) -> JSON: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. @@ -4250,29 +5291,76 @@ async def start_log_collection( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ @distributed_trace_async async def start_log_collection( - self, - log_collection_id: str, - log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], - **kwargs: Any - ) -> _models.LogCollection: + self, log_collection_id: str, log_collection: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :param log_collection: The log collection properties. Is either a LogCollection type or a - IO[bytes] type. Required. - :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or - ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :param log_collection: The log collection properties. Is either a JSON type or a IO[bytes] + type. Required. + :type log_collection: JSON or IO[bytes] + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + log_collection = { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } + + # response body for status code(s): 201 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4286,20 +5374,22 @@ async def start_log_collection( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LogCollection] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" + _json = None _content = None if isinstance(log_collection, (IOBase, bytes)): _content = log_collection else: - _content = json.dumps(log_collection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = log_collection _request = build_device_management_start_log_collection_request( log_collection_id=log_collection_id, instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -4324,31 +5414,48 @@ async def start_log_collection( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.LogCollection, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace_async - async def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> _models.LogCollection: + async def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> JSON: """Get the device diagnostics log collection. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4361,7 +5468,7 @@ async def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.LogCollection] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_log_collection_request( log_collection_id=log_collection_id, @@ -4390,34 +5497,51 @@ async def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> _mo except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.LogCollection, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_log_collections(self, **kwargs: Any) -> AsyncItemPaged["_models.LogCollection"]: + def list_log_collections(self, **kwargs: Any) -> AsyncItemPaged[JSON]: """Get all device diagnostics log collections. - :return: An iterator like instance of LogCollection - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.LogCollection] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.LogCollection]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4466,10 +5590,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.LogCollection], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4485,28 +5606,43 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_log_collection_detailed_status( - self, log_collection_id: str, **kwargs: Any - ) -> _models.LogCollectionOperationDetailedStatus: + async def get_log_collection_detailed_status(self, log_collection_id: str, **kwargs: Any) -> JSON: """Get log collection with detailed status. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :return: LogCollectionOperationDetailedStatus. The LogCollectionOperationDetailedStatus is - compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "description": "str", + "deviceStatus": [ + { + "deviceId": "str", + "status": "str", + "extendedResultCode": "str", + "logLocation": "str", + "moduleId": "str", + "resultCode": "str" + } + ], + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4519,7 +5655,7 @@ async def get_log_collection_detailed_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.LogCollectionOperationDetailedStatus] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_log_collection_detailed_status_request( log_collection_id=log_collection_id, @@ -4548,37 +5684,53 @@ async def get_log_collection_detailed_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.LogCollectionOperationDetailedStatus, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_health_of_devices(self, *, filter: str, **kwargs: Any) -> AsyncItemPaged["_models.DeviceHealth"]: + def list_health_of_devices(self, *, filter: str, **kwargs: Any) -> AsyncItemPaged[JSON]: """Get list of device health. :keyword filter: Restricts the set of devices for which device health is returned. You can filter on status, device id and module id. Required. :paramtype filter: str - :return: An iterator like instance of DeviceHealth - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.iot.deviceupdate.models.DeviceHealth] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.async_paging.AsyncItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceId": "str", + "healthChecks": [ + { + "name": "str", + "result": "str" + } + ], + "state": "str", + "digitalTwinModelId": "str", + "moduleId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceHealth]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4628,10 +5780,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceHealth], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4647,11 +5796,7 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py index d1fd91da9223..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py @@ -7,41 +7,11 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, Optional, get_args -from azure.core import MatchConditions -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) - -from ..._utils.model_base import _is_model __all__: list[str] = [] # Add all objects you want publicly available to users at this package level -def _contains_model(deserializer: Any) -> bool: - if _is_model(deserializer): - return True - return any(_contains_model(argument) for argument in get_args(deserializer)) - - -def _conditional_kwargs(if_none_match: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: - if if_none_match is not None: - kwargs["etag"] = if_none_match - kwargs["match_condition"] = MatchConditions.IfModified - return kwargs - - -def _rename_orderby(orderby: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: - kwargs["order_by"] = orderby - return kwargs - - def patch_sdk(): """Do not remove from this file. @@ -49,170 +19,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - from . import _operations - - update_operations = _operations.DeviceUpdateOperations - management_operations = _operations.DeviceManagementOperations - - generated_deserialize = getattr(_operations, "_deserialize") - - def raw_model_deserialize(deserializer, value, *args, **kwargs): - if _contains_model(deserializer): - return value - return generated_deserialize(deserializer, value, *args, **kwargs) - - setattr(_operations, "_deserialize", raw_model_deserialize) - - get_update = update_operations.get_update - get_file = update_operations.get_file - get_update_operation = update_operations.get_operation_status - list_update_operations = update_operations.list_operation_statuses - - async def legacy_get_update(self, provider, name, version, *, if_none_match=None, **kwargs): - return await get_update(self, provider, name, version, **_conditional_kwargs(if_none_match, kwargs)) - - async def legacy_get_file(self, provider, name, version, file_id, *, if_none_match=None, **kwargs): - return await get_file(self, provider, name, version, file_id, **_conditional_kwargs(if_none_match, kwargs)) - - async def legacy_get_update_operation(self, operation_id, *, if_none_match=None, **kwargs): - return await get_update_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) - - update_operations.get_update = legacy_get_update - update_operations.get_file = legacy_get_file - setattr(update_operations, "get_operation", legacy_get_update_operation) - setattr(update_operations, "list_operations", list_update_operations) - - mappings = { - "get_operation": "get_operation_status", - "list_operations": "list_operation_statuses", - "get_group_update_compliance": "get_update_compliance_for_group", - "get_device_class_subgroup_details": "get_device_class_subgroup", - "list_best_updates_for_device_class_subgroup": "get_best_updates_for_device_class_subgroup", - "delete_device_class_subgroup_deployment": "delete_deployment_for_device_class_subgroup", - "list_devices_for_device_class_subgroup_deployment": "list_device_states_for_device_class_subgroup_deployment", - "collect_logs": "start_log_collection", - "get_log_collection_operation": "get_log_collection", - "list_log_collection_operations": "list_log_collections", - "get_log_collection_operation_detailed_status": "get_log_collection_detailed_status", - "list_device_health": "list_health_of_devices", - } - saved = {old: getattr(management_operations, new) for old, new in mappings.items()} - for old, method in saved.items(): - setattr(management_operations, old, method) - - get_management_operation = saved["get_operation"] - collect_logs = saved["collect_logs"] - get_log_collection = saved["get_log_collection_operation"] - get_log_collection_status = saved["get_log_collection_operation_detailed_status"] - - async def legacy_get_management_operation(self, operation_id, *, if_none_match=None, **kwargs): - return await get_management_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) - - setattr(management_operations, "get_operation", legacy_get_management_operation) - - async def legacy_collect_logs(self, operation_id, log_collection_request, **kwargs): - return await collect_logs(self, operation_id, log_collection_request, **kwargs) - - async def legacy_get_log_collection(self, operation_id, **kwargs): - return await get_log_collection(self, operation_id, **kwargs) - - async def legacy_get_log_collection_status(self, operation_id, **kwargs): - return await get_log_collection_status(self, operation_id, **kwargs) - - setattr(management_operations, "collect_logs", legacy_collect_logs) - setattr(management_operations, "get_log_collection_operation", legacy_get_log_collection) - setattr( - management_operations, - "get_log_collection_operation_detailed_status", - legacy_get_log_collection_status, - ) - - list_device_classes = management_operations.list_device_classes - list_groups = management_operations.list_groups - - list_group_deployments = management_operations.list_deployments_for_group - list_subgroup_deployments = management_operations.list_deployments_for_device_class_subgroup - list_best_updates = management_operations.list_best_updates_for_group - list_device_class_subgroups = management_operations.list_device_class_subgroups_for_group - - def legacy_list_device_classes(self, **kwargs): - return list_device_classes(self, **kwargs) - - def legacy_list_groups(self, *, orderby=None, **kwargs): - return list_groups(self, **_rename_orderby(orderby, kwargs)) - - def legacy_list_group_deployments(self, group_id, *, orderby=None, **kwargs): - return list_group_deployments(self, group_id, **_rename_orderby(orderby, kwargs)) - - def legacy_list_subgroup_deployments(self, group_id, device_class_id, *, orderby=None, **kwargs): - return list_subgroup_deployments(self, group_id, device_class_id, **_rename_orderby(orderby, kwargs)) - - def legacy_list_best_updates(self, group_id, *, filter=None, **kwargs): - if filter is not None: - params = dict(kwargs.pop("params", {}) or {}) - params["$filter"] = filter - kwargs["params"] = params - return list_best_updates(self, group_id, **kwargs) - - async def legacy_list_device_class_subgroups(self, group_id, *, filter=None, **kwargs): - return list_device_class_subgroups(self, group_id, filter=filter, **kwargs) - - management_operations.list_device_classes = legacy_list_device_classes - management_operations.list_groups = legacy_list_groups - management_operations.list_deployments_for_group = legacy_list_group_deployments - management_operations.list_deployments_for_device_class_subgroup = legacy_list_subgroup_deployments - management_operations.list_best_updates_for_group = legacy_list_best_updates - management_operations.list_device_class_subgroups_for_group = legacy_list_device_class_subgroups - - async def legacy_list_device_health(self, *, filter, **kwargs): - headers = kwargs.pop("headers", {}) or {} - params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - request = _operations.build_device_management_list_health_of_devices_request( - instance_id=self._config.instance_id, - filter=filter, - api_version=self._config.api_version, - headers=headers, - params=params, - ) - request.url = self._client.format_url( - request.url, - endpoint=self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - ) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - if response.status_code != 200: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - deserialized = response.json() if response.content else None - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - setattr(management_operations, "list_device_health", legacy_list_device_health) - - for operation_name in { - "get_operation_status", - "list_operation_statuses", - "get_update_compliance_for_group", - "get_device_class_subgroup", - "get_best_updates_for_device_class_subgroup", - "delete_deployment_for_device_class_subgroup", - "list_device_states_for_device_class_subgroup_deployment", - "start_log_collection", - "get_log_collection", - "list_log_collections", - "get_log_collection_detailed_status", - "list_health_of_devices", - }: - delattr(management_operations, operation_name) - - delattr(update_operations, "get_operation_status") - delattr(update_operations, "list_operation_statuses") diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/__init__.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/__init__.py deleted file mode 100644 index 12fa9c0a854a..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/__init__.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# 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 typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - CloudInitiatedRollbackPolicy, - CloudInitiatedRollbackPolicyFailure, - Compatibility, - ContractModel, - Deployment, - DeploymentDeviceState, - DeploymentStatus, - Device, - DeviceClass, - DeviceClassProperties, - DeviceClassSubgroup, - DeviceClassSubgroupDeploymentStatus, - DeviceClassSubgroupUpdatableDevices, - DeviceHealth, - DeviceOperation, - DeviceUpdateAgentId, - Error, - ErrorResponse, - FileImportMetadata, - Group, - HealthCheck, - ImportManifestMetadata, - ImportUpdateInputItem, - InnerError, - InstallResult, - Instructions, - LogCollection, - LogCollectionOperationDetailedStatus, - LogCollectionOperationDeviceStatus, - PatchBody, - Step, - StepResult, - Update, - UpdateCompliance, - UpdateFile, - UpdateFileBase, - UpdateFileDownloadHandler, - UpdateId, - UpdateInfo, - UpdateOperation, -) - -from ._enums import ( # type: ignore - DeploymentState, - DeviceClassSubgroupDeploymentState, - DeviceDeploymentState, - DeviceHealthState, - DownloadSecurity, - GroupType, - HealthCheckResult, - ImportType, - OperationStatus, - StepType, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "CloudInitiatedRollbackPolicy", - "CloudInitiatedRollbackPolicyFailure", - "Compatibility", - "ContractModel", - "Deployment", - "DeploymentDeviceState", - "DeploymentStatus", - "Device", - "DeviceClass", - "DeviceClassProperties", - "DeviceClassSubgroup", - "DeviceClassSubgroupDeploymentStatus", - "DeviceClassSubgroupUpdatableDevices", - "DeviceHealth", - "DeviceOperation", - "DeviceUpdateAgentId", - "Error", - "ErrorResponse", - "FileImportMetadata", - "Group", - "HealthCheck", - "ImportManifestMetadata", - "ImportUpdateInputItem", - "InnerError", - "InstallResult", - "Instructions", - "LogCollection", - "LogCollectionOperationDetailedStatus", - "LogCollectionOperationDeviceStatus", - "PatchBody", - "Step", - "StepResult", - "Update", - "UpdateCompliance", - "UpdateFile", - "UpdateFileBase", - "UpdateFileDownloadHandler", - "UpdateId", - "UpdateInfo", - "UpdateOperation", - "DeploymentState", - "DeviceClassSubgroupDeploymentState", - "DeviceDeploymentState", - "DeviceHealthState", - "DownloadSecurity", - "GroupType", - "HealthCheckResult", - "ImportType", - "OperationStatus", - "StepType", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_enums.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_enums.py deleted file mode 100644 index 4d101dbce148..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_enums.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class DeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Deployment state.""" - - ACTIVE = "Active" - """The deployment can be sent to devices targeted in the deployment.""" - ACTIVE_WITH_SUBGROUP_FAILURES = "ActiveWithSubgroupFailures" - """The deployment can be sent to some devices targeted in the deployment but at least 1 subgroup - is in a failed state.""" - FAILED = "Failed" - """The deployment will not be sent to any devices. Consult error for more details about what - failed.""" - INACTIVE = "Inactive" - """A newer deployment for this group has been created and no devices in the group will receive - this deployment.""" - CANCELED = "Canceled" - """The deployment has been canceled and no devices will receive it.""" - - -class DeviceClassSubgroupDeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Device class subgroup deployment state.""" - - ACTIVE = "Active" - """The subgroup deployment can be sent to devices targeted in the deployment.""" - FAILED = "Failed" - """The subgroup deployment failed and will not be sent to any devices.""" - INACTIVE = "Inactive" - """A newer deployment for this subgroup has been created and no devices in the subgroup will - receive this deployment.""" - CANCELED = "Canceled" - """The subgroup deployment has been canceled and no devices will receive it.""" - - -class DeviceDeploymentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Deployment state.""" - - SUCCEEDED = "Succeeded" - """Deployment has completed with success.""" - IN_PROGRESS = "InProgress" - """Deployment is in progress.""" - CANCELED = "Canceled" - """Deployment was canceled.""" - FAILED = "Failed" - """Deployment has completed with failure.""" - - -class DeviceHealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Device health states.""" - - HEALTHY = "healthy" - """Agent is healthy.""" - UNHEALTHY = "unhealthy" - """Agent is in an unhealthy state.""" - - -class DownloadSecurity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The protocol the device should use when downloading the update payload.""" - - HTTPS = "https" - """Download update payload over HTTPS.""" - HTTP = "http" - """Download update payload over HTTP.""" - - -class GroupType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Supported group types.""" - - IO_T_HUB_TAG = "IoTHubTag" - """IoT Hub tag based group, all devices in the group share an ADUGroup tag value.""" - DEFAULT_NO_TAG = "DefaultNoTag" - """Default group for untagged devices.""" - - -class HealthCheckResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Health check result.""" - - SUCCESS = "success" - """Health check succeeded.""" - USER_ERROR = "userError" - """Health check failed due to user error.""" - - -class ImportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The device import type.""" - - DEVICES = "Devices" - """Import only devices but not modules.""" - MODULES = "Modules" - """Import only modules but not devices.""" - ALL = "All" - """Import both devices and modules.""" - - -class OperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation status.""" - - NOT_STARTED = "NotStarted" - """Background operation created but not started yet.""" - RUNNING = "Running" - """Background operation is currently running.""" - SUCCEEDED = "Succeeded" - """Background operation finished with success.""" - FAILED = "Failed" - """Background operation finished with failure.""" - - -class StepType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Step type.""" - - INLINE = "inline" - """Step type that performs code execution.""" - REFERENCE = "reference" - """Step type that installs another update.""" diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_models.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_models.py deleted file mode 100644 index 40e0d650001a..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_models.py +++ /dev/null @@ -1,2156 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -import datetime -from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload - -from .._utils.model_base import Model as _Model, rest_field - -if TYPE_CHECKING: - from .. import models as _models - - -class CloudInitiatedRollbackPolicy(_Model): - """Rollback policy for deployment. - - :ivar update_property: Update to rollback to. Required. - :vartype update_property: ~azure.iot.deviceupdate.models.UpdateInfo - :ivar failure: Failure conditions to initiate rollback policy. Required. - :vartype failure: ~azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure - """ - - update_property: "_models.UpdateInfo" = rest_field( - name="update", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="update" - ) - """Update to rollback to. Required.""" - failure: "_models.CloudInitiatedRollbackPolicyFailure" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Failure conditions to initiate rollback policy. Required.""" - - @overload - def __init__( - self, - *, - update_property: "_models.UpdateInfo", - failure: "_models.CloudInitiatedRollbackPolicyFailure", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class CloudInitiatedRollbackPolicyFailure(_Model): - """Failure conditions to initiate rollback policy. - - :ivar devices_failed_percentage: Percentage of devices that failed. Required. - :vartype devices_failed_percentage: int - :ivar devices_failed_count: Number of devices that failed. Required. - :vartype devices_failed_count: int - """ - - devices_failed_percentage: int = rest_field( - name="devicesFailedPercentage", visibility=["read", "create", "update", "delete", "query"] - ) - """Percentage of devices that failed. Required.""" - devices_failed_count: int = rest_field( - name="devicesFailedCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of devices that failed. Required.""" - - @overload - def __init__( - self, - *, - devices_failed_percentage: int, - devices_failed_count: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Compatibility(_Model): - """Key-value pairs representing update compatibility information.""" - - -class ContractModel(_Model): - """The Device Update agent contract model. - - :ivar id: The Device Update agent contract model Id of the device class. This is also used to - calculate the device class Id. Required. - :vartype id: str - :ivar name: The Device Update agent contract model name of the device class. Intended to be a - more readable form of the contract model Id. Required. - :vartype name: str - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Device Update agent contract model Id of the device class. This is also used to calculate - the device class Id. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The Device Update agent contract model name of the device class. Intended to be a more readable - form of the contract model Id. Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Deployment(_Model): - """Deployment metadata. - - :ivar deployment_id: The caller-provided deployment identifier. This cannot be longer than 73 - characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', - '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub - resource generates a GUID for deploymentId when you create a deployment. Required. - :vartype deployment_id: str - :ivar start_date_time: The deployment start datetime. Required. - :vartype start_date_time: ~datetime.datetime - :ivar update_property: Update information for the update in the deployment. Required. - :vartype update_property: ~azure.iot.deviceupdate.models.UpdateInfo - :ivar group_id: The group identity for the devices the deployment is intended to update. - Required. - :vartype group_id: str - :ivar device_class_subgroups: The device class subgroups the deployment is compatible with and - subgroup deployments have been created for. This is not provided by the caller during - CreateOrUpdateDeployment but is automatically determined by Device Update. - :vartype device_class_subgroups: list[str] - :ivar is_canceled: Boolean flag indicating whether the deployment was canceled. - :vartype is_canceled: bool - :ivar is_retried: Boolean flag indicating whether the deployment has been retried. - :vartype is_retried: bool - :ivar rollback_policy: The rollback policy for the deployment. - :vartype rollback_policy: ~azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy - :ivar is_cloud_initiated_rollback: Boolean flag indicating whether the deployment is a rollback - deployment. - :vartype is_cloud_initiated_rollback: bool - :ivar download_security: The protocol the device should use when downloading the update - payload. Defaults to "https". Known values are: "https" and "http". - :vartype download_security: str or ~azure.iot.deviceupdate.models.DownloadSecurity - """ - - deployment_id: str = rest_field(name="deploymentId", visibility=["read", "create", "update", "delete", "query"]) - """The caller-provided deployment identifier. This cannot be longer than 73 characters, must be - all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, - backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a - GUID for deploymentId when you create a deployment. Required.""" - start_date_time: datetime.datetime = rest_field( - name="startDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """The deployment start datetime. Required.""" - update_property: "_models.UpdateInfo" = rest_field( - name="update", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="update" - ) - """Update information for the update in the deployment. Required.""" - group_id: str = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """The group identity for the devices the deployment is intended to update. Required.""" - device_class_subgroups: Optional[list[str]] = rest_field( - name="deviceClassSubgroups", visibility=["read", "create", "update", "delete", "query"] - ) - """The device class subgroups the deployment is compatible with and subgroup deployments have been - created for. This is not provided by the caller during CreateOrUpdateDeployment but is - automatically determined by Device Update.""" - is_canceled: Optional[bool] = rest_field( - name="isCanceled", visibility=["read", "create", "update", "delete", "query"] - ) - """Boolean flag indicating whether the deployment was canceled.""" - is_retried: Optional[bool] = rest_field( - name="isRetried", visibility=["read", "create", "update", "delete", "query"] - ) - """Boolean flag indicating whether the deployment has been retried.""" - rollback_policy: Optional["_models.CloudInitiatedRollbackPolicy"] = rest_field( - name="rollbackPolicy", visibility=["read", "create", "update", "delete", "query"] - ) - """The rollback policy for the deployment.""" - is_cloud_initiated_rollback: Optional[bool] = rest_field( - name="isCloudInitiatedRollback", visibility=["read", "create", "update", "delete", "query"] - ) - """Boolean flag indicating whether the deployment is a rollback deployment.""" - download_security: Optional[Union[str, "_models.DownloadSecurity"]] = rest_field( - name="downloadSecurity", visibility=["read", "create", "update", "delete", "query"] - ) - """The protocol the device should use when downloading the update payload. Defaults to \"https\". - Known values are: \"https\" and \"http\".""" - - @overload - def __init__( - self, - *, - deployment_id: str, - start_date_time: datetime.datetime, - update_property: "_models.UpdateInfo", - group_id: str, - device_class_subgroups: Optional[list[str]] = None, - is_canceled: Optional[bool] = None, - is_retried: Optional[bool] = None, - rollback_policy: Optional["_models.CloudInitiatedRollbackPolicy"] = None, - is_cloud_initiated_rollback: Optional[bool] = None, - download_security: Optional[Union[str, "_models.DownloadSecurity"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeploymentDeviceState(_Model): - """Deployment device status. - - :ivar device_id: Device identity. Required. - :vartype device_id: str - :ivar module_id: Device module identity. - :vartype module_id: str - :ivar retry_count: The number of times this deployment has been retried on this device. - Required. - :vartype retry_count: int - :ivar moved_on_to_new_deployment: Boolean flag indicating whether this device is in a newer - deployment and can no longer retry this deployment. Required. - :vartype moved_on_to_new_deployment: bool - :ivar device_state: Deployment device state. Required. Known values are: "Succeeded", - "InProgress", "Canceled", and "Failed". - :vartype device_state: str or ~azure.iot.deviceupdate.models.DeviceDeploymentState - """ - - device_id: str = rest_field(name="deviceId", visibility=["read", "create", "update", "delete", "query"]) - """Device identity. Required.""" - module_id: Optional[str] = rest_field(name="moduleId", visibility=["read", "create", "update", "delete", "query"]) - """Device module identity.""" - retry_count: int = rest_field(name="retryCount", visibility=["read", "create", "update", "delete", "query"]) - """The number of times this deployment has been retried on this device. Required.""" - moved_on_to_new_deployment: bool = rest_field( - name="movedOnToNewDeployment", visibility=["read", "create", "update", "delete", "query"] - ) - """Boolean flag indicating whether this device is in a newer deployment and can no longer retry - this deployment. Required.""" - device_state: Union[str, "_models.DeviceDeploymentState"] = rest_field( - name="deviceState", visibility=["read", "create", "update", "delete", "query"] - ) - """Deployment device state. Required. Known values are: \"Succeeded\", \"InProgress\", - \"Canceled\", and \"Failed\".""" - - @overload - def __init__( - self, - *, - device_id: str, - retry_count: int, - moved_on_to_new_deployment: bool, - device_state: Union[str, "_models.DeviceDeploymentState"], - module_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeploymentStatus(_Model): - """Deployment status metadata. - - :ivar group_id: The group identity. Required. - :vartype group_id: str - :ivar deployment_state: The state of the deployment. Required. Known values are: "Active", - "ActiveWithSubgroupFailures", "Failed", "Inactive", and "Canceled". - :vartype deployment_state: str or ~azure.iot.deviceupdate.models.DeploymentState - :ivar error: The error details of the Failed state. This is not present if the deployment - state is not Failed. - :vartype error: ~azure.iot.deviceupdate.models.Error - :ivar subgroup_status: The collection of device class subgroup status objects. Required. - :vartype subgroup_status: - list[~azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus] - """ - - group_id: str = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """The group identity. Required.""" - deployment_state: Union[str, "_models.DeploymentState"] = rest_field( - name="deploymentState", visibility=["read", "create", "update", "delete", "query"] - ) - """The state of the deployment. Required. Known values are: \"Active\", - \"ActiveWithSubgroupFailures\", \"Failed\", \"Inactive\", and \"Canceled\".""" - error: Optional["_models.Error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error details of the Failed state. This is not present if the deployment state is not - Failed.""" - subgroup_status: list["_models.DeviceClassSubgroupDeploymentStatus"] = rest_field( - name="subgroupStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """The collection of device class subgroup status objects. Required.""" - - @overload - def __init__( - self, - *, - group_id: str, - deployment_state: Union[str, "_models.DeploymentState"], - subgroup_status: list["_models.DeviceClassSubgroupDeploymentStatus"], - error: Optional["_models.Error"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Device(_Model): - """Device metadata. - - :ivar device_id: Device identity. Required. - :vartype device_id: str - :ivar module_id: Device module identity. - :vartype module_id: str - :ivar device_class_id: Device class identity. Required. - :vartype device_class_id: str - :ivar group_id: Device group identity. - :vartype group_id: str - :ivar last_attempted_update: The update that device last attempted to install. - :vartype last_attempted_update: ~azure.iot.deviceupdate.models.UpdateInfo - :ivar deployment_status: State of the device in its last deployment. Known values are: - "Succeeded", "InProgress", "Canceled", and "Failed". - :vartype deployment_status: str or ~azure.iot.deviceupdate.models.DeviceDeploymentState - :ivar installed_update: Currently installed update on device. - :vartype installed_update: ~azure.iot.deviceupdate.models.UpdateInfo - :ivar on_latest_update: Boolean flag indicating whether the latest update (the best compatible - update for the device's device class and group) is installed on the device. Required. - :vartype on_latest_update: bool - :ivar last_deployment_id: The deployment identifier for the last deployment to the device. - :vartype last_deployment_id: str - :ivar last_install_result: Last install result. - :vartype last_install_result: ~azure.iot.deviceupdate.models.InstallResult - """ - - device_id: str = rest_field(name="deviceId", visibility=["read", "create", "update", "delete", "query"]) - """Device identity. Required.""" - module_id: Optional[str] = rest_field(name="moduleId", visibility=["read", "create", "update", "delete", "query"]) - """Device module identity.""" - device_class_id: str = rest_field(name="deviceClassId", visibility=["read", "create", "update", "delete", "query"]) - """Device class identity. Required.""" - group_id: Optional[str] = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """Device group identity.""" - last_attempted_update: Optional["_models.UpdateInfo"] = rest_field( - name="lastAttemptedUpdate", visibility=["read", "create", "update", "delete", "query"] - ) - """The update that device last attempted to install.""" - deployment_status: Optional[Union[str, "_models.DeviceDeploymentState"]] = rest_field( - name="deploymentStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """State of the device in its last deployment. Known values are: \"Succeeded\", \"InProgress\", - \"Canceled\", and \"Failed\".""" - installed_update: Optional["_models.UpdateInfo"] = rest_field( - name="installedUpdate", visibility=["read", "create", "update", "delete", "query"] - ) - """Currently installed update on device.""" - on_latest_update: bool = rest_field( - name="onLatestUpdate", visibility=["read", "create", "update", "delete", "query"] - ) - """Boolean flag indicating whether the latest update (the best compatible update for the device's - device class and group) is installed on the device. Required.""" - last_deployment_id: Optional[str] = rest_field( - name="lastDeploymentId", visibility=["read", "create", "update", "delete", "query"] - ) - """The deployment identifier for the last deployment to the device.""" - last_install_result: Optional["_models.InstallResult"] = rest_field( - name="lastInstallResult", visibility=["read", "create", "update", "delete", "query"] - ) - """Last install result.""" - - @overload - def __init__( - self, - *, - device_id: str, - device_class_id: str, - on_latest_update: bool, - module_id: Optional[str] = None, - group_id: Optional[str] = None, - last_attempted_update: Optional["_models.UpdateInfo"] = None, - deployment_status: Optional[Union[str, "_models.DeviceDeploymentState"]] = None, - installed_update: Optional["_models.UpdateInfo"] = None, - last_deployment_id: Optional[str] = None, - last_install_result: Optional["_models.InstallResult"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceClass(_Model): - """Device class metadata. - - :ivar device_class_id: The device class identifier. This is generated from the model Id and the - compat properties reported by the device update agent in the Device Update PnP interface in IoT - Hub. It is a hex-encoded SHA1 hash. Required. - :vartype device_class_id: str - :ivar friendly_name: The device class friendly name. This can be updated by callers after the - device class has been automatically created. - :vartype friendly_name: str - :ivar device_class_properties: The device class properties that are used to calculate the - device class Id. Required. - :vartype device_class_properties: ~azure.iot.deviceupdate.models.DeviceClassProperties - :ivar best_compatible_update: Update that is the highest version compatible with this device - class. - :vartype best_compatible_update: ~azure.iot.deviceupdate.models.UpdateInfo - """ - - device_class_id: str = rest_field(name="deviceClassId", visibility=["read", "create", "update", "delete", "query"]) - """The device class identifier. This is generated from the model Id and the compat properties - reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a - hex-encoded SHA1 hash. Required.""" - friendly_name: Optional[str] = rest_field( - name="friendlyName", visibility=["read", "create", "update", "delete", "query"] - ) - """The device class friendly name. This can be updated by callers after the device class has been - automatically created.""" - device_class_properties: "_models.DeviceClassProperties" = rest_field( - name="deviceClassProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """The device class properties that are used to calculate the device class Id. Required.""" - best_compatible_update: Optional["_models.UpdateInfo"] = rest_field( - name="bestCompatibleUpdate", visibility=["read", "create", "update", "delete", "query"] - ) - """Update that is the highest version compatible with this device class.""" - - @overload - def __init__( - self, - *, - device_class_id: str, - device_class_properties: "_models.DeviceClassProperties", - friendly_name: Optional[str] = None, - best_compatible_update: Optional["_models.UpdateInfo"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceClassProperties(_Model): - """The device class properties that are used to calculate the device class Id. - - :ivar contract_model: The Device Update agent contract model. - :vartype contract_model: ~azure.iot.deviceupdate.models.ContractModel - :ivar compat_properties: The compat properties of the device class. This object can be thought - of as a set of key-value pairs where the key is the name of the compatibility property and the - value is the value of the compatibility property. There will always be at least 1 compat - property. Required. - :vartype compat_properties: dict[str, str] - """ - - contract_model: Optional["_models.ContractModel"] = rest_field( - name="contractModel", visibility=["read", "create", "update", "delete", "query"] - ) - """The Device Update agent contract model.""" - compat_properties: dict[str, str] = rest_field( - name="compatProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """The compat properties of the device class. This object can be thought of as a set of key-value - pairs where the key is the name of the compatibility property and the value is the value of the - compatibility property. There will always be at least 1 compat property. Required.""" - - @overload - def __init__( - self, - *, - compat_properties: dict[str, str], - contract_model: Optional["_models.ContractModel"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceClassSubgroup(_Model): - """Device class subgroup details. A device class subgroup is a subset of devices in a group that - share the same device class id. - - :ivar device_class_id: Device class subgroup identity. This is generated from the model Id and - the compat properties reported by the device update agent in the Device Update PnP interface in - IoT Hub. It is a hex-encoded SHA1 hash. Required. - :vartype device_class_id: str - :ivar group_id: Group identity. Required. - :vartype group_id: str - :ivar created_date_time: Date and time when the device class subgroup was created. Required. - :vartype created_date_time: str - :ivar device_count: The number of devices in the device class subgroup. - :vartype device_count: int - :ivar deployment_id: The active deployment Id for the device class subgroup. - :vartype deployment_id: str - """ - - device_class_id: str = rest_field(name="deviceClassId", visibility=["read", "create", "update", "delete", "query"]) - """Device class subgroup identity. This is generated from the model Id and the compat properties - reported by the device update agent in the Device Update PnP interface in IoT Hub. It is a - hex-encoded SHA1 hash. Required.""" - group_id: str = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """Group identity. Required.""" - created_date_time: str = rest_field( - name="createdDateTime", visibility=["read", "create", "update", "delete", "query"] - ) - """Date and time when the device class subgroup was created. Required.""" - device_count: Optional[int] = rest_field( - name="deviceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of devices in the device class subgroup.""" - deployment_id: Optional[str] = rest_field( - name="deploymentId", visibility=["read", "create", "update", "delete", "query"] - ) - """The active deployment Id for the device class subgroup.""" - - @overload - def __init__( - self, - *, - device_class_id: str, - group_id: str, - created_date_time: str, - device_count: Optional[int] = None, - deployment_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceClassSubgroupDeploymentStatus(_Model): - """Device class subgroup deployment status metadata. - - :ivar group_id: The group identity. Required. - :vartype group_id: str - :ivar device_class_id: The device class subgroup identity. Required. - :vartype device_class_id: str - :ivar deployment_state: The state of the subgroup deployment. Required. Known values are: - "Active", "Failed", "Inactive", and "Canceled". - :vartype deployment_state: str or - ~azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState - :ivar error: The error details of the Failed state. This is not present if the deployment - state is not Failed. - :vartype error: ~azure.iot.deviceupdate.models.Error - :ivar total_devices: The total number of devices in the deployment. - :vartype total_devices: int - :ivar devices_in_progress_count: The number of devices that are currently in deployment. - :vartype devices_in_progress_count: int - :ivar devices_completed_failed_count: The number of devices that have completed deployment with - a failure. - :vartype devices_completed_failed_count: int - :ivar devices_completed_succeeded_count: The number of devices which have successfully - completed deployment. - :vartype devices_completed_succeeded_count: int - :ivar devices_canceled_count: The number of devices which have had their deployment canceled. - :vartype devices_canceled_count: int - """ - - group_id: str = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """The group identity. Required.""" - device_class_id: str = rest_field(name="deviceClassId", visibility=["read", "create", "update", "delete", "query"]) - """The device class subgroup identity. Required.""" - deployment_state: Union[str, "_models.DeviceClassSubgroupDeploymentState"] = rest_field( - name="deploymentState", visibility=["read", "create", "update", "delete", "query"] - ) - """The state of the subgroup deployment. Required. Known values are: \"Active\", \"Failed\", - \"Inactive\", and \"Canceled\".""" - error: Optional["_models.Error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error details of the Failed state. This is not present if the deployment state is not - Failed.""" - total_devices: Optional[int] = rest_field( - name="totalDevices", visibility=["read", "create", "update", "delete", "query"] - ) - """The total number of devices in the deployment.""" - devices_in_progress_count: Optional[int] = rest_field( - name="devicesInProgressCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of devices that are currently in deployment.""" - devices_completed_failed_count: Optional[int] = rest_field( - name="devicesCompletedFailedCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of devices that have completed deployment with a failure.""" - devices_completed_succeeded_count: Optional[int] = rest_field( - name="devicesCompletedSucceededCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of devices which have successfully completed deployment.""" - devices_canceled_count: Optional[int] = rest_field( - name="devicesCanceledCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of devices which have had their deployment canceled.""" - - @overload - def __init__( - self, - *, - group_id: str, - device_class_id: str, - deployment_state: Union[str, "_models.DeviceClassSubgroupDeploymentState"], - error: Optional["_models.Error"] = None, - total_devices: Optional[int] = None, - devices_in_progress_count: Optional[int] = None, - devices_completed_failed_count: Optional[int] = None, - devices_completed_succeeded_count: Optional[int] = None, - devices_canceled_count: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceClassSubgroupUpdatableDevices(_Model): - """Device class subgroup, update information, and the number of devices for which the update is - applicable. - - :ivar group_id: The group Id. Required. - :vartype group_id: str - :ivar device_class_id: The device class subgroup's device class Id. Required. - :vartype device_class_id: str - :ivar update_property: Update information. Required. - :vartype update_property: ~azure.iot.deviceupdate.models.UpdateInfo - :ivar device_count: Total number of devices for which the update is applicable. Required. - :vartype device_count: int - """ - - group_id: str = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """The group Id. Required.""" - device_class_id: str = rest_field(name="deviceClassId", visibility=["read", "create", "update", "delete", "query"]) - """The device class subgroup's device class Id. Required.""" - update_property: "_models.UpdateInfo" = rest_field( - name="update", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="update" - ) - """Update information. Required.""" - device_count: int = rest_field(name="deviceCount", visibility=["read", "create", "update", "delete", "query"]) - """Total number of devices for which the update is applicable. Required.""" - - @overload - def __init__( - self, - *, - group_id: str, - device_class_id: str, - update_property: "_models.UpdateInfo", - device_count: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceHealth(_Model): - """Device Health. - - :ivar device_id: Device id. Required. - :vartype device_id: str - :ivar module_id: Module id. - :vartype module_id: str - :ivar state: Aggregate device health state. Required. Known values are: "healthy" and - "unhealthy". - :vartype state: str or ~azure.iot.deviceupdate.models.DeviceHealthState - :ivar digital_twin_model_id: Digital twin model Id. - :vartype digital_twin_model_id: str - :ivar health_checks: Array of health checks and their results. Required. - :vartype health_checks: list[~azure.iot.deviceupdate.models.HealthCheck] - """ - - device_id: str = rest_field(name="deviceId", visibility=["read", "create", "update", "delete", "query"]) - """Device id. Required.""" - module_id: Optional[str] = rest_field(name="moduleId", visibility=["read", "create", "update", "delete", "query"]) - """Module id.""" - state: Union[str, "_models.DeviceHealthState"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Aggregate device health state. Required. Known values are: \"healthy\" and \"unhealthy\".""" - digital_twin_model_id: Optional[str] = rest_field( - name="digitalTwinModelId", visibility=["read", "create", "update", "delete", "query"] - ) - """Digital twin model Id.""" - health_checks: list["_models.HealthCheck"] = rest_field( - name="healthChecks", visibility=["read", "create", "update", "delete", "query"] - ) - """Array of health checks and their results. Required.""" - - @overload - def __init__( - self, - *, - device_id: str, - state: Union[str, "_models.DeviceHealthState"], - health_checks: list["_models.HealthCheck"], - module_id: Optional[str] = None, - digital_twin_model_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceOperation(_Model): - """Operation metadata. - - :ivar operation_id: Operation Id. Required. - :vartype operation_id: str - :ivar status: Operation status. Required. Known values are: "NotStarted", "Running", - "Succeeded", and "Failed". - :vartype status: str or ~azure.iot.deviceupdate.models.OperationStatus - :ivar error: Operation error encountered, if any. - :vartype error: ~azure.iot.deviceupdate.models.Error - :ivar trace_id: Operation correlation identity that can used by Microsoft Support for - troubleshooting. - :vartype trace_id: str - :ivar last_action_date_time: Date and time in UTC when the operation status was last updated. - Required. - :vartype last_action_date_time: ~datetime.datetime - :ivar created_date_time: Date and time in UTC when the operation was created. Required. - :vartype created_date_time: ~datetime.datetime - :ivar etag: Operation ETag. - :vartype etag: str - """ - - operation_id: str = rest_field(name="operationId", visibility=["read", "create", "update", "delete", "query"]) - """Operation Id. Required.""" - status: Union[str, "_models.OperationStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Operation status. Required. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and - \"Failed\".""" - error: Optional["_models.Error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Operation error encountered, if any.""" - trace_id: Optional[str] = rest_field(name="traceId", visibility=["read", "create", "update", "delete", "query"]) - """Operation correlation identity that can used by Microsoft Support for troubleshooting.""" - last_action_date_time: datetime.datetime = rest_field( - name="lastActionDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time in UTC when the operation status was last updated. Required.""" - created_date_time: datetime.datetime = rest_field( - name="createdDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time in UTC when the operation was created. Required.""" - etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Operation ETag.""" - - @overload - def __init__( - self, - *, - operation_id: str, - status: Union[str, "_models.OperationStatus"], - last_action_date_time: datetime.datetime, - created_date_time: datetime.datetime, - error: Optional["_models.Error"] = None, - trace_id: Optional[str] = None, - etag: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceUpdateAgentId(_Model): - """Device Update agent id. - - :ivar device_id: Device Id. Required. - :vartype device_id: str - :ivar module_id: Module Id. - :vartype module_id: str - """ - - device_id: str = rest_field(name="deviceId", visibility=["read", "create", "update", "delete", "query"]) - """Device Id. Required.""" - module_id: Optional[str] = rest_field(name="moduleId", visibility=["read", "create", "update", "delete", "query"]) - """Module Id.""" - - @overload - def __init__( - self, - *, - device_id: str, - module_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Error(_Model): - """Error details. - - :ivar code: Server defined error code. Required. - :vartype code: str - :ivar message: A human-readable representation of the error. Required. - :vartype message: str - :ivar target: The target of the error. - :vartype target: str - :ivar details: An array of errors that led to the reported error. - :vartype details: list[~azure.iot.deviceupdate.models.Error] - :ivar innererror: An object containing more specific information than the current object about - the error. - :vartype innererror: ~azure.iot.deviceupdate.models.InnerError - :ivar occurred_date_time: Date and time in UTC when the error occurred. - :vartype occurred_date_time: ~datetime.datetime - """ - - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Server defined error code. Required.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable representation of the error. Required.""" - target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The target of the error.""" - details: Optional[list["_models.Error"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An array of errors that led to the reported error.""" - innererror: Optional["_models.InnerError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An object containing more specific information than the current object about the error.""" - occurred_date_time: Optional[datetime.datetime] = rest_field( - name="occurredDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time in UTC when the error occurred.""" - - @overload - def __init__( - self, - *, - code: str, - message: str, - target: Optional[str] = None, - details: Optional[list["_models.Error"]] = None, - innererror: Optional["_models.InnerError"] = None, - occurred_date_time: Optional[datetime.datetime] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ErrorResponse(_Model): - """Common error response. - - :ivar error: The error details. Required. - :vartype error: ~azure.iot.deviceupdate.models.Error - """ - - error: "_models.Error" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error details. Required.""" - - @overload - def __init__( - self, - *, - error: "_models.Error", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class FileImportMetadata(_Model): - """Metadata describing an update file. - - :ivar filename: Update file name as specified inside import manifest. Required. - :vartype filename: str - :ivar url: Azure Blob location from which the update file can be downloaded by Device Update - for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at - least 4 hours. Required. - :vartype url: str - """ - - filename: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Update file name as specified inside import manifest. Required.""" - url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. - This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 - hours. Required.""" - - @overload - def __init__( - self, - *, - filename: str, - url: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Group(_Model): - """Group details. - - :ivar group_id: Group identity. This is created from the value of the ADUGroup tag in the Iot - Hub's device/module twin or $default for devices with no tag. Required. - :vartype group_id: str - :ivar group_type: Group type. Required. Known values are: "IoTHubTag" and "DefaultNoTag". - :vartype group_type: str or ~azure.iot.deviceupdate.models.GroupType - :ivar created_date_time: Date and time when the update was created. Required. - :vartype created_date_time: str - :ivar device_count: The number of devices in the group. - :vartype device_count: int - :ivar subgroups_with_new_updates_available_count: The count of subgroups with new updates - available. - :vartype subgroups_with_new_updates_available_count: int - :ivar subgroups_with_updates_in_progress_count: The count of subgroups with updates in - progress. - :vartype subgroups_with_updates_in_progress_count: int - :ivar subgroups_with_on_latest_update_count: The count of subgroups with devices on the latest - update. - :vartype subgroups_with_on_latest_update_count: int - :ivar deployments: The active deployment Ids for the group. - :vartype deployments: list[str] - """ - - group_id: str = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) - """Group identity. This is created from the value of the ADUGroup tag in the Iot Hub's - device/module twin or $default for devices with no tag. Required.""" - group_type: Union[str, "_models.GroupType"] = rest_field( - name="groupType", visibility=["read", "create", "update", "delete", "query"] - ) - """Group type. Required. Known values are: \"IoTHubTag\" and \"DefaultNoTag\".""" - created_date_time: str = rest_field( - name="createdDateTime", visibility=["read", "create", "update", "delete", "query"] - ) - """Date and time when the update was created. Required.""" - device_count: Optional[int] = rest_field( - name="deviceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The number of devices in the group.""" - subgroups_with_new_updates_available_count: Optional[int] = rest_field( - name="subgroupsWithNewUpdatesAvailableCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The count of subgroups with new updates available.""" - subgroups_with_updates_in_progress_count: Optional[int] = rest_field( - name="subgroupsWithUpdatesInProgressCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The count of subgroups with updates in progress.""" - subgroups_with_on_latest_update_count: Optional[int] = rest_field( - name="subgroupsWithOnLatestUpdateCount", visibility=["read", "create", "update", "delete", "query"] - ) - """The count of subgroups with devices on the latest update.""" - deployments: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The active deployment Ids for the group.""" - - @overload - def __init__( - self, - *, - group_id: str, - group_type: Union[str, "_models.GroupType"], - created_date_time: str, - device_count: Optional[int] = None, - subgroups_with_new_updates_available_count: Optional[int] = None, - subgroups_with_updates_in_progress_count: Optional[int] = None, - subgroups_with_on_latest_update_count: Optional[int] = None, - deployments: Optional[list[str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class HealthCheck(_Model): - """Health check. - - :ivar name: Health check name. - :vartype name: str - :ivar result: Health check result. Known values are: "success" and "userError". - :vartype result: str or ~azure.iot.deviceupdate.models.HealthCheckResult - """ - - name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Health check name.""" - result: Optional[Union[str, "_models.HealthCheckResult"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Health check result. Known values are: \"success\" and \"userError\".""" - - @overload - def __init__( - self, - *, - name: Optional[str] = None, - result: Optional[Union[str, "_models.HealthCheckResult"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImportManifestMetadata(_Model): - """Metadata describing the import manifest, a document which describes the files and other - metadata about an update version. - - :ivar url: Azure Blob location from which the import manifest can be downloaded by Device - Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set - to at least 4 hours. Required. - :vartype url: str - :ivar size_in_bytes: File size in number of bytes. Required. - :vartype size_in_bytes: int - :ivar hashes: A JSON object containing the hash(es) of the file. At least SHA256 hash is - required. This object can be thought of as a set of key-value pairs where the key is the hash - algorithm, and the value is the hash of the file calculated using that algorithm. Required. - :vartype hashes: dict[str, str] - """ - - url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Azure Blob location from which the import manifest can be downloaded by Device Update for IoT - Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 - hours. Required.""" - size_in_bytes: int = rest_field(name="sizeInBytes", visibility=["read", "create", "update", "delete", "query"]) - """File size in number of bytes. Required.""" - hashes: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This - object can be thought of as a set of key-value pairs where the key is the hash algorithm, and - the value is the hash of the file calculated using that algorithm. Required.""" - - @overload - def __init__( - self, - *, - url: str, - size_in_bytes: int, - hashes: dict[str, str], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class ImportUpdateInputItem(_Model): - """Import update input item metadata. - - :ivar import_manifest: Import manifest metadata like source URL, file size/hashes, etc. - Required. - :vartype import_manifest: ~azure.iot.deviceupdate.models.ImportManifestMetadata - :ivar friendly_name: Friendly update name. - :vartype friendly_name: str - :ivar files: One or more update file properties like filename and source URL. - :vartype files: list[~azure.iot.deviceupdate.models.FileImportMetadata] - """ - - import_manifest: "_models.ImportManifestMetadata" = rest_field( - name="importManifest", visibility=["read", "create", "update", "delete", "query"] - ) - """Import manifest metadata like source URL, file size/hashes, etc. Required.""" - friendly_name: Optional[str] = rest_field( - name="friendlyName", visibility=["read", "create", "update", "delete", "query"] - ) - """Friendly update name.""" - files: Optional[list["_models.FileImportMetadata"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """One or more update file properties like filename and source URL.""" - - @overload - def __init__( - self, - *, - import_manifest: "_models.ImportManifestMetadata", - friendly_name: Optional[str] = None, - files: Optional[list["_models.FileImportMetadata"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InnerError(_Model): - """An object containing more specific information than the current object about the error. - - :ivar code: A more specific error code than what was provided by the containing error. - Required. - :vartype code: str - :ivar message: A human-readable representation of the error. - :vartype message: str - :ivar error_detail: The internal error or exception message. - :vartype error_detail: str - :ivar inner_error: An object containing more specific information than the current object about - the error. - :vartype inner_error: ~azure.iot.deviceupdate.models.InnerError - """ - - code: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A more specific error code than what was provided by the containing error. Required.""" - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable representation of the error.""" - error_detail: Optional[str] = rest_field( - name="errorDetail", visibility=["read", "create", "update", "delete", "query"] - ) - """The internal error or exception message.""" - inner_error: Optional["_models.InnerError"] = rest_field( - name="innerError", visibility=["read", "create", "update", "delete", "query"] - ) - """An object containing more specific information than the current object about the error.""" - - @overload - def __init__( - self, - *, - code: str, - message: Optional[str] = None, - error_detail: Optional[str] = None, - inner_error: Optional["_models.InnerError"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class InstallResult(_Model): - """The install result of an update and any step results under it. - - :ivar result_code: Install result code. Required. - :vartype result_code: int - :ivar extended_result_code: Install extended result code. Required. - :vartype extended_result_code: int - :ivar result_details: A string containing further details about the install result. - :vartype result_details: str - :ivar step_results: Array of step results. - :vartype step_results: list[~azure.iot.deviceupdate.models.StepResult] - """ - - result_code: int = rest_field(name="resultCode", visibility=["read", "create", "update", "delete", "query"]) - """Install result code. Required.""" - extended_result_code: int = rest_field( - name="extendedResultCode", visibility=["read", "create", "update", "delete", "query"] - ) - """Install extended result code. Required.""" - result_details: Optional[str] = rest_field( - name="resultDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """A string containing further details about the install result.""" - step_results: Optional[list["_models.StepResult"]] = rest_field( - name="stepResults", visibility=["read", "create", "update", "delete", "query"] - ) - """Array of step results.""" - - @overload - def __init__( - self, - *, - result_code: int, - extended_result_code: int, - result_details: Optional[str] = None, - step_results: Optional[list["_models.StepResult"]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Instructions(_Model): - """Update install instructions container. - - :ivar steps: Collection of installation steps. Required. - :vartype steps: list[~azure.iot.deviceupdate.models.Step] - """ - - steps: list["_models.Step"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Collection of installation steps. Required.""" - - @overload - def __init__( - self, - *, - steps: list["_models.Step"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LogCollection(_Model): - """Diagnostics request body. - - :ivar log_collection_id: The log collection id. - :vartype log_collection_id: str - :ivar device_list: Array of Device Update agent ids. Required. - :vartype device_list: list[~azure.iot.deviceupdate.models.DeviceUpdateAgentId] - :ivar description: Description of the diagnostics operation. - :vartype description: str - :ivar created_date_time: The timestamp when the operation was created. - :vartype created_date_time: str - :ivar last_action_date_time: A timestamp for when the current state was entered. - :vartype last_action_date_time: str - :ivar status: Operation status. Known values are: "NotStarted", "Running", "Succeeded", and - "Failed". - :vartype status: str or ~azure.iot.deviceupdate.models.OperationStatus - """ - - log_collection_id: Optional[str] = rest_field( - name="operationId", visibility=["read", "create", "update", "delete", "query"] - ) - """The log collection id.""" - device_list: list["_models.DeviceUpdateAgentId"] = rest_field( - name="deviceList", visibility=["read", "create", "update", "delete", "query"] - ) - """Array of Device Update agent ids. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Description of the diagnostics operation.""" - created_date_time: Optional[str] = rest_field(name="createdDateTime", visibility=["read"]) - """The timestamp when the operation was created.""" - last_action_date_time: Optional[str] = rest_field(name="lastActionDateTime", visibility=["read"]) - """A timestamp for when the current state was entered.""" - status: Optional[Union[str, "_models.OperationStatus"]] = rest_field(visibility=["read"]) - """Operation status. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and \"Failed\".""" - - @overload - def __init__( - self, - *, - device_list: list["_models.DeviceUpdateAgentId"], - log_collection_id: Optional[str] = None, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LogCollectionOperationDetailedStatus(_Model): - """Device diagnostics operation detailed status. - - :ivar log_collection_id: The device diagnostics operation id. - :vartype log_collection_id: str - :ivar created_date_time: The timestamp when the operation was created. - :vartype created_date_time: str - :ivar last_action_date_time: A timestamp for when the current state was entered. - :vartype last_action_date_time: str - :ivar status: Operation status. Known values are: "NotStarted", "Running", "Succeeded", and - "Failed". - :vartype status: str or ~azure.iot.deviceupdate.models.OperationStatus - :ivar device_status: Status of the devices in the operation. - :vartype device_status: list[~azure.iot.deviceupdate.models.LogCollectionOperationDeviceStatus] - :ivar description: Device diagnostics operation description. - :vartype description: str - """ - - log_collection_id: Optional[str] = rest_field( - name="operationId", visibility=["read", "create", "update", "delete", "query"] - ) - """The device diagnostics operation id.""" - created_date_time: Optional[str] = rest_field( - name="createdDateTime", visibility=["read", "create", "update", "delete", "query"] - ) - """The timestamp when the operation was created.""" - last_action_date_time: Optional[str] = rest_field( - name="lastActionDateTime", visibility=["read", "create", "update", "delete", "query"] - ) - """A timestamp for when the current state was entered.""" - status: Optional[Union[str, "_models.OperationStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Operation status. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and \"Failed\".""" - device_status: Optional[list["_models.LogCollectionOperationDeviceStatus"]] = rest_field( - name="deviceStatus", visibility=["read", "create", "update", "delete", "query"] - ) - """Status of the devices in the operation.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Device diagnostics operation description.""" - - @overload - def __init__( - self, - *, - log_collection_id: Optional[str] = None, - created_date_time: Optional[str] = None, - last_action_date_time: Optional[str] = None, - status: Optional[Union[str, "_models.OperationStatus"]] = None, - device_status: Optional[list["_models.LogCollectionOperationDeviceStatus"]] = None, - description: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class LogCollectionOperationDeviceStatus(_Model): - """Diagnostics operation device status. - - :ivar device_id: Device id. Required. - :vartype device_id: str - :ivar module_id: Module id. - :vartype module_id: str - :ivar status: Log upload status. Required. Known values are: "NotStarted", "Running", - "Succeeded", and "Failed". - :vartype status: str or ~azure.iot.deviceupdate.models.OperationStatus - :ivar result_code: Log upload result code. - :vartype result_code: str - :ivar extended_result_code: Log upload extended result code. - :vartype extended_result_code: str - :ivar log_location: Log upload location. - :vartype log_location: str - """ - - device_id: str = rest_field(name="deviceId", visibility=["read", "create", "update", "delete", "query"]) - """Device id. Required.""" - module_id: Optional[str] = rest_field(name="moduleId", visibility=["read", "create", "update", "delete", "query"]) - """Module id.""" - status: Union[str, "_models.OperationStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Log upload status. Required. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and - \"Failed\".""" - result_code: Optional[str] = rest_field( - name="resultCode", visibility=["read", "create", "update", "delete", "query"] - ) - """Log upload result code.""" - extended_result_code: Optional[str] = rest_field( - name="extendedResultCode", visibility=["read", "create", "update", "delete", "query"] - ) - """Log upload extended result code.""" - log_location: Optional[str] = rest_field( - name="logLocation", visibility=["read", "create", "update", "delete", "query"] - ) - """Log upload location.""" - - @overload - def __init__( - self, - *, - device_id: str, - status: Union[str, "_models.OperationStatus"], - module_id: Optional[str] = None, - result_code: Optional[str] = None, - extended_result_code: Optional[str] = None, - log_location: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class PatchBody(_Model): - """Device Class JSON Merge Patch request body. - - :ivar friendly_name: The device class friendly name. Friendly name can be 1-100 characters, - alphanumeric, dot, and dash. Required. - :vartype friendly_name: str - """ - - friendly_name: str = rest_field(name="friendlyName", visibility=["read", "create", "update", "delete", "query"]) - """The device class friendly name. Friendly name can be 1-100 characters, alphanumeric, dot, and - dash. Required.""" - - @overload - def __init__( - self, - *, - friendly_name: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Step(_Model): - """Update install instruction step. - - :ivar type: Step type. Known values are: "inline" and "reference". - :vartype type: str or ~azure.iot.deviceupdate.models.StepType - :ivar description: Step description. - :vartype description: str - :ivar handler: Identity of handler that will execute this step. Required if step type is - inline. - :vartype handler: str - :ivar handler_properties: Parameters to be passed to handler during execution. - :vartype handler_properties: dict[str, any] - :ivar files: Collection of file names to be passed to handler during execution. Required if - step type is inline. - :vartype files: list[str] - :ivar update_id: Referenced child update identity. Required if step type is reference. - :vartype update_id: ~azure.iot.deviceupdate.models.UpdateId - """ - - type: Optional[Union[str, "_models.StepType"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Step type. Known values are: \"inline\" and \"reference\".""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Step description.""" - handler: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Identity of handler that will execute this step. Required if step type is inline.""" - handler_properties: Optional[dict[str, Any]] = rest_field( - name="handlerProperties", visibility=["read", "create", "update", "delete", "query"] - ) - """Parameters to be passed to handler during execution.""" - files: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Collection of file names to be passed to handler during execution. Required if step type is - inline.""" - update_id: Optional["_models.UpdateId"] = rest_field( - name="updateId", visibility=["read", "create", "update", "delete", "query"] - ) - """Referenced child update identity. Required if step type is reference.""" - - @overload - def __init__( - self, - *, - type: Optional[Union[str, "_models.StepType"]] = None, - description: Optional[str] = None, - handler: Optional[str] = None, - handler_properties: Optional[dict[str, Any]] = None, - files: Optional[list[str]] = None, - update_id: Optional["_models.UpdateId"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class StepResult(_Model): - """The step result under an update. - - :ivar update_property: The update that this step installs if it is of reference type. - :vartype update_property: ~azure.iot.deviceupdate.models.UpdateInfo - :ivar description: Step description. - :vartype description: str - :ivar result_code: Install result code. Required. - :vartype result_code: int - :ivar extended_result_code: Install extended result code. Required. - :vartype extended_result_code: int - :ivar result_details: A string containing further details about the install result. - :vartype result_details: str - """ - - update_property: Optional["_models.UpdateInfo"] = rest_field( - name="update", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="update" - ) - """The update that this step installs if it is of reference type.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Step description.""" - result_code: int = rest_field(name="resultCode", visibility=["read", "create", "update", "delete", "query"]) - """Install result code. Required.""" - extended_result_code: int = rest_field( - name="extendedResultCode", visibility=["read", "create", "update", "delete", "query"] - ) - """Install extended result code. Required.""" - result_details: Optional[str] = rest_field( - name="resultDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """A string containing further details about the install result.""" - - @overload - def __init__( - self, - *, - result_code: int, - extended_result_code: int, - update_property: Optional["_models.UpdateInfo"] = None, - description: Optional[str] = None, - result_details: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class Update(_Model): - """Update metadata. - - :ivar update_id: Update identity. Required. - :vartype update_id: ~azure.iot.deviceupdate.models.UpdateId - :ivar description: Update description specified by creator. - :vartype description: str - :ivar friendly_name: Friendly update name specified by importer. - :vartype friendly_name: str - :ivar is_deployable: Whether the update can be deployed to a device on its own. - :vartype is_deployable: bool - :ivar update_type: Update type. Deprecated in latest import manifest schema. - :vartype update_type: str - :ivar installed_criteria: String interpreted by Device Update client to determine if the update - is installed on the device. Deprecated in latest import manifest schema. - :vartype installed_criteria: str - :ivar compatibility: List of update compatibility information. Required. - :vartype compatibility: list[~azure.iot.deviceupdate.models.Compatibility] - :ivar instructions: Update install instructions. - :vartype instructions: ~azure.iot.deviceupdate.models.Instructions - :ivar referenced_by: List of update identities that reference this update. - :vartype referenced_by: list[~azure.iot.deviceupdate.models.UpdateId] - :ivar scan_result: Update aggregate scan result (calculated from payload file scan results). - :vartype scan_result: str - :ivar manifest_version: Schema version of manifest used to import the update. Required. - :vartype manifest_version: str - :ivar imported_date_time: Date and time in UTC when the update was imported. Required. - :vartype imported_date_time: ~datetime.datetime - :ivar created_date_time: Date and time in UTC when the update was created. Required. - :vartype created_date_time: ~datetime.datetime - :ivar etag: Update ETag. - :vartype etag: str - """ - - update_id: "_models.UpdateId" = rest_field( - name="updateId", visibility=["read", "create", "update", "delete", "query"] - ) - """Update identity. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Update description specified by creator.""" - friendly_name: Optional[str] = rest_field( - name="friendlyName", visibility=["read", "create", "update", "delete", "query"] - ) - """Friendly update name specified by importer.""" - is_deployable: Optional[bool] = rest_field( - name="isDeployable", visibility=["read", "create", "update", "delete", "query"] - ) - """Whether the update can be deployed to a device on its own.""" - update_type: Optional[str] = rest_field( - name="updateType", visibility=["read", "create", "update", "delete", "query"] - ) - """Update type. Deprecated in latest import manifest schema.""" - installed_criteria: Optional[str] = rest_field( - name="installedCriteria", visibility=["read", "create", "update", "delete", "query"] - ) - """String interpreted by Device Update client to determine if the update is installed on the - device. Deprecated in latest import manifest schema.""" - compatibility: list["_models.Compatibility"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of update compatibility information. Required.""" - instructions: Optional["_models.Instructions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Update install instructions.""" - referenced_by: Optional[list["_models.UpdateId"]] = rest_field( - name="referencedBy", visibility=["read", "create", "update", "delete", "query"] - ) - """List of update identities that reference this update.""" - scan_result: Optional[str] = rest_field( - name="scanResult", visibility=["read", "create", "update", "delete", "query"] - ) - """Update aggregate scan result (calculated from payload file scan results).""" - manifest_version: str = rest_field( - name="manifestVersion", visibility=["read", "create", "update", "delete", "query"] - ) - """Schema version of manifest used to import the update. Required.""" - imported_date_time: datetime.datetime = rest_field( - name="importedDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time in UTC when the update was imported. Required.""" - created_date_time: datetime.datetime = rest_field( - name="createdDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time in UTC when the update was created. Required.""" - etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Update ETag.""" - - @overload - def __init__( - self, - *, - update_id: "_models.UpdateId", - compatibility: list["_models.Compatibility"], - manifest_version: str, - imported_date_time: datetime.datetime, - created_date_time: datetime.datetime, - description: Optional[str] = None, - friendly_name: Optional[str] = None, - is_deployable: Optional[bool] = None, - update_type: Optional[str] = None, - installed_criteria: Optional[str] = None, - instructions: Optional["_models.Instructions"] = None, - referenced_by: Optional[list["_models.UpdateId"]] = None, - scan_result: Optional[str] = None, - etag: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateCompliance(_Model): - """Update compliance information. - - :ivar total_device_count: Total number of devices. Required. - :vartype total_device_count: int - :ivar on_latest_update_device_count: Number of devices on the latest update. Required. - :vartype on_latest_update_device_count: int - :ivar new_updates_available_device_count: Number of devices with a newer update available. - Required. - :vartype new_updates_available_device_count: int - :ivar updates_in_progress_device_count: Number of devices with update in-progress. Required. - :vartype updates_in_progress_device_count: int - """ - - total_device_count: int = rest_field( - name="totalDeviceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Total number of devices. Required.""" - on_latest_update_device_count: int = rest_field( - name="onLatestUpdateDeviceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of devices on the latest update. Required.""" - new_updates_available_device_count: int = rest_field( - name="newUpdatesAvailableDeviceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of devices with a newer update available. Required.""" - updates_in_progress_device_count: int = rest_field( - name="updatesInProgressDeviceCount", visibility=["read", "create", "update", "delete", "query"] - ) - """Number of devices with update in-progress. Required.""" - - @overload - def __init__( - self, - *, - total_device_count: int, - on_latest_update_device_count: int, - new_updates_available_device_count: int, - updates_in_progress_device_count: int, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateFileBase(_Model): - """Update file basic metadata. - - :ivar file_name: File name. Required. - :vartype file_name: str - :ivar size_in_bytes: File size in number of bytes. Required. - :vartype size_in_bytes: int - :ivar hashes: Mapping of hashing algorithm to base64 encoded hash values. Required. - :vartype hashes: dict[str, str] - :ivar mime_type: File MIME type. - :vartype mime_type: str - :ivar scan_result: Anti-malware scan result. - :vartype scan_result: str - :ivar scan_details: Anti-malware scan details. - :vartype scan_details: str - :ivar properties: Optional file properties (not consumed by service but pass-through to - device). - :vartype properties: dict[str, str] - """ - - file_name: str = rest_field(name="fileName", visibility=["read", "create", "update", "delete", "query"]) - """File name. Required.""" - size_in_bytes: int = rest_field(name="sizeInBytes", visibility=["read", "create", "update", "delete", "query"]) - """File size in number of bytes. Required.""" - hashes: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Mapping of hashing algorithm to base64 encoded hash values. Required.""" - mime_type: Optional[str] = rest_field(name="mimeType", visibility=["read", "create", "update", "delete", "query"]) - """File MIME type.""" - scan_result: Optional[str] = rest_field( - name="scanResult", visibility=["read", "create", "update", "delete", "query"] - ) - """Anti-malware scan result.""" - scan_details: Optional[str] = rest_field( - name="scanDetails", visibility=["read", "create", "update", "delete", "query"] - ) - """Anti-malware scan details.""" - properties: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional file properties (not consumed by service but pass-through to device).""" - - @overload - def __init__( - self, - *, - file_name: str, - size_in_bytes: int, - hashes: dict[str, str], - mime_type: Optional[str] = None, - scan_result: Optional[str] = None, - scan_details: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateFile(UpdateFileBase): - """Update file metadata. - - :ivar file_name: File name. Required. - :vartype file_name: str - :ivar size_in_bytes: File size in number of bytes. Required. - :vartype size_in_bytes: int - :ivar hashes: Mapping of hashing algorithm to base64 encoded hash values. Required. - :vartype hashes: dict[str, str] - :ivar mime_type: File MIME type. - :vartype mime_type: str - :ivar scan_result: Anti-malware scan result. - :vartype scan_result: str - :ivar scan_details: Anti-malware scan details. - :vartype scan_details: str - :ivar properties: Optional file properties (not consumed by service but pass-through to - device). - :vartype properties: dict[str, str] - :ivar file_id: File identity, generated by server at import time. Required. - :vartype file_id: str - :ivar related_files: Optional related files metadata used together DownloadHandler metadata to - download payload file. - :vartype related_files: list[~azure.iot.deviceupdate.models.UpdateFileBase] - :ivar download_handler: Optional download handler for utilizing related files to download - payload file. - :vartype download_handler: ~azure.iot.deviceupdate.models.UpdateFileDownloadHandler - :ivar etag: File ETag. - :vartype etag: str - """ - - file_id: str = rest_field(name="fileId", visibility=["read", "create", "update", "delete", "query"]) - """File identity, generated by server at import time. Required.""" - related_files: Optional[list["_models.UpdateFileBase"]] = rest_field( - name="relatedFiles", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional related files metadata used together DownloadHandler metadata to download payload - file.""" - download_handler: Optional["_models.UpdateFileDownloadHandler"] = rest_field( - name="downloadHandler", visibility=["read", "create", "update", "delete", "query"] - ) - """Optional download handler for utilizing related files to download payload file.""" - etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """File ETag.""" - - @overload - def __init__( - self, - *, - file_name: str, - size_in_bytes: int, - hashes: dict[str, str], - file_id: str, - mime_type: Optional[str] = None, - scan_result: Optional[str] = None, - scan_details: Optional[str] = None, - properties: Optional[dict[str, str]] = None, - related_files: Optional[list["_models.UpdateFileBase"]] = None, - download_handler: Optional["_models.UpdateFileDownloadHandler"] = None, - etag: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateFileDownloadHandler(_Model): - """Download handler for utilizing related files to download payload file. - - :ivar id: Download handler identifier. Required. - :vartype id: str - """ - - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Download handler identifier. Required.""" - - @overload - def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateId(_Model): - """Update identifier. - - :ivar provider: Update provider. Required. - :vartype provider: str - :ivar name: Update name. Required. - :vartype name: str - :ivar version: Update version. Required. - :vartype version: str - """ - - provider: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Update provider. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Update name. Required.""" - version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Update version. Required.""" - - @overload - def __init__( - self, - *, - provider: str, - name: str, - version: str, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateInfo(_Model): - """Update information. - - :ivar update_id: Update identifier. Required. - :vartype update_id: ~azure.iot.deviceupdate.models.UpdateId - :ivar description: Update description. - :vartype description: str - :ivar friendly_name: Friendly update name. - :vartype friendly_name: str - """ - - update_id: "_models.UpdateId" = rest_field( - name="updateId", visibility=["read", "create", "update", "delete", "query"] - ) - """Update identifier. Required.""" - description: Optional[str] = rest_field(visibility=["read"]) - """Update description.""" - friendly_name: Optional[str] = rest_field(name="friendlyName", visibility=["read"]) - """Friendly update name.""" - - @overload - def __init__( - self, - *, - update_id: "_models.UpdateId", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class UpdateOperation(_Model): - """Operation metadata. - - :ivar operation_id: Operation Id. Required. - :vartype operation_id: str - :ivar status: Operation status. Required. Known values are: "NotStarted", "Running", - "Succeeded", and "Failed". - :vartype status: str or ~azure.iot.deviceupdate.models.OperationStatus - :ivar update_property: The update being imported or deleted. For import, this property will - only be populated after import manifest is processed successfully. - :vartype update_property: ~azure.iot.deviceupdate.models.UpdateInfo - :ivar resource_location: Location of the imported update when operation is successful. - :vartype resource_location: str - :ivar error: Operation error encountered, if any. - :vartype error: ~azure.iot.deviceupdate.models.Error - :ivar trace_id: Operation correlation identity that can used by Microsoft Support for - troubleshooting. - :vartype trace_id: str - :ivar last_action_date_time: Date and time in UTC when the operation status was last updated. - Required. - :vartype last_action_date_time: ~datetime.datetime - :ivar created_date_time: Date and time in UTC when the operation was created. Required. - :vartype created_date_time: ~datetime.datetime - :ivar etag: Operation ETag. - :vartype etag: str - """ - - operation_id: str = rest_field(name="operationId", visibility=["read", "create", "update", "delete", "query"]) - """Operation Id. Required.""" - status: Union[str, "_models.OperationStatus"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Operation status. Required. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and - \"Failed\".""" - update_property: Optional["_models.UpdateInfo"] = rest_field( - name="update", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="update" - ) - """The update being imported or deleted. For import, this property will only be populated after - import manifest is processed successfully.""" - resource_location: Optional[str] = rest_field( - name="resourceLocation", visibility=["read", "create", "update", "delete", "query"] - ) - """Location of the imported update when operation is successful.""" - error: Optional["_models.Error"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Operation error encountered, if any.""" - trace_id: Optional[str] = rest_field(name="traceId", visibility=["read", "create", "update", "delete", "query"]) - """Operation correlation identity that can used by Microsoft Support for troubleshooting.""" - last_action_date_time: datetime.datetime = rest_field( - name="lastActionDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time in UTC when the operation status was last updated. Required.""" - created_date_time: datetime.datetime = rest_field( - name="createdDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" - ) - """Date and time in UTC when the operation was created. Required.""" - etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Operation ETag.""" - - @overload - def __init__( - self, - *, - operation_id: str, - status: Union[str, "_models.OperationStatus"], - last_action_date_time: datetime.datetime, - created_date_time: datetime.datetime, - update_property: Optional["_models.UpdateInfo"] = None, - resource_location: Optional[str] = None, - error: Optional["_models.Error"] = None, - trace_id: Optional[str] = None, - etag: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py deleted file mode 100644 index 4ec80a127c47..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/models/_patch.py +++ /dev/null @@ -1,24 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -import sys - - -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ - models_module = sys.modules[__package__] - models_module.__all__.clear() diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py index 399aa0d59b77..3d066148b573 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py @@ -8,7 +8,6 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -import json from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse @@ -32,12 +31,11 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models, types as _types from .._configuration import DeviceUpdateClientConfiguration -from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer from .._utils.utils import prep_if_match, prep_if_none_match +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] @@ -553,7 +551,7 @@ def build_device_management_list_devices_request( # pylint: disable=name-too-lo def build_device_management_import_devices_request( # pylint: disable=name-too-long - instance_id: str, **kwargs: Any + instance_id: str, *, json: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -574,7 +572,7 @@ def build_device_management_import_devices_request( # pylint: disable=name-too- # Construct headers _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, json=json, **kwargs) def build_device_management_get_device_request( # pylint: disable=name-too-long @@ -1494,21 +1492,73 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_updates( self, *, search: Optional[str] = None, filter: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Update"]: + ) -> ItemPaged[JSON]: """Get a list of all updates that have been imported to Device Update for IoT Hub. :keyword search: Request updates matching a free-text search expression. Default value is None. :paramtype search: str :keyword filter: Optional to filter updates by isDeployable property. Default value is None. :paramtype filter: str - :return: An iterator like instance of Update - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.Update] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "compatibility": [ + {} + ], + "createdDateTime": "2020-02-20 00:00:00", + "importedDateTime": "2020-02-20 00:00:00", + "manifestVersion": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "etag": "str", + "friendlyName": "str", + "installedCriteria": "str", + "instructions": { + "steps": [ + { + "description": "str", + "files": [ + "str" + ], + "handler": "str", + "handlerProperties": { + "str": {} + }, + "type": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + } + } + ] + }, + "isDeployable": bool, + "referencedBy": [ + { + "name": "str", + "provider": "str", + "version": "str" + } + ], + "scanResult": "str", + "updateType": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Update]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1559,10 +1609,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Update], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1578,21 +1625,13 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) - def _import_update_initial( - self, - update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + def _import_update_initial(self, update_to_import: Union[list[JSON], IO[bytes]], **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1608,16 +1647,18 @@ def _import_update_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) content_type = content_type or "application/json" + _json = None _content = None if isinstance(update_to_import, (IOBase, bytes)): _content = update_to_import else: - _content = json.dumps(update_to_import, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = update_to_import _request = build_device_update_import_update_request( instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -1641,11 +1682,7 @@ def _import_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} if response.status_code == 202: @@ -1656,17 +1693,13 @@ def _import_update_initial( deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(Iterator[bytes], deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(Iterator[bytes], deserialized) # type: ignore @overload def begin_import_update( - self, - update_to_import: list[_models.ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any + self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. @@ -1675,37 +1708,36 @@ def begin_import_update( `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for details). Required. - :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] + :type update_to_import: list[JSON] :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def begin_import_update( - self, - update_to_import: list[_types.ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Import new update version. This is a long-running-operation; use Operation-Location response - header value to check for operation status. + Example: + .. code-block:: python - :param update_to_import: The update to be imported (see schema - `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json - `_ for - details). Required. - :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: + # JSON input template you can fill out and use as your body input. + update_to_import = [ + { + "importManifest": { + "hashes": { + "str": "str" + }, + "sizeInBytes": 0, + "url": "str" + }, + "files": [ + { + "filename": "str", + "url": "str" + } + ], + "friendlyName": "str" + } + ] """ @overload @@ -1729,20 +1761,15 @@ def begin_import_update( """ @distributed_trace - def begin_import_update( - self, - update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: + def begin_import_update(self, update_to_import: Union[list[JSON], IO[bytes]], **kwargs: Any) -> LROPoller[None]: """Import new update version. This is a long-running-operation; use Operation-Location response header value to check for operation status. :param update_to_import: The update to be imported (see schema `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json `_ for - details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. - :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or - list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] + details). Is either a [JSON] type or a IO[bytes] type. Required. + :type update_to_import: list[JSON] or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1802,7 +1829,7 @@ def get_update( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.Update: + ) -> JSON: """Get a specific update version. :param provider: Update provider. Required. @@ -1816,9 +1843,61 @@ def get_update( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: Update. The Update is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Update + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "compatibility": [ + {} + ], + "createdDateTime": "2020-02-20 00:00:00", + "importedDateTime": "2020-02-20 00:00:00", + "manifestVersion": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "etag": "str", + "friendlyName": "str", + "installedCriteria": "str", + "instructions": { + "steps": [ + { + "description": "str", + "files": [ + "str" + ], + "handler": "str", + "handlerProperties": { + "str": {} + }, + "type": "str", + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + } + } + ] + }, + "isDeployable": bool, + "referencedBy": [ + { + "name": "str", + "provider": "str", + "version": "str" + } + ], + "scanResult": "str", + "updateType": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1837,7 +1916,7 @@ def get_update( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Update] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_update_get_update_request( provider=provider, @@ -1870,21 +1949,20 @@ def get_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Update, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore def _delete_update_initial(self, provider: str, name: str, version: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1928,11 +2006,7 @@ def _delete_update_initial(self, provider: str, name: str, version: str, **kwarg except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) @@ -1940,9 +2014,9 @@ def _delete_update_initial(self, provider: str, name: str, version: str, **kwarg deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(Iterator[bytes], deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(Iterator[bytes], deserialized) # type: ignore @distributed_trace def begin_delete_update(self, provider: str, name: str, version: str, **kwargs: Any) -> LROPoller[None]: @@ -2011,6 +2085,12 @@ def list_providers(self, **kwargs: Any) -> ItemPaged[str]: :return: An iterator like instance of str :rtype: ~azure.core.paging.ItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -2064,10 +2144,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2083,11 +2160,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -2102,6 +2175,12 @@ def list_names(self, provider: str, **kwargs: Any) -> ItemPaged[str]: :return: An iterator like instance of str :rtype: ~azure.core.paging.ItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -2156,10 +2235,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2175,11 +2251,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -2198,6 +2270,12 @@ def list_versions(self, provider: str, name: str, *, filter: Optional[str] = Non :return: An iterator like instance of str :rtype: ~azure.core.paging.ItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -2254,10 +2332,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2273,11 +2348,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -2296,6 +2367,12 @@ def list_files(self, provider: str, name: str, version: str, **kwargs: Any) -> I :return: An iterator like instance of str :rtype: ~azure.core.paging.ItemPaged[str] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == "str" """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} @@ -2352,10 +2429,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[str], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2371,11 +2445,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -2392,7 +2462,7 @@ def get_file( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.UpdateFile: + ) -> JSON: """Get a specific update file from the version. :param provider: Update provider. Required. @@ -2408,9 +2478,47 @@ def get_file( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: UpdateFile. The UpdateFile is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateFile + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "fileId": "str", + "fileName": "str", + "hashes": { + "str": "str" + }, + "sizeInBytes": 0, + "downloadHandler": { + "id": "str" + }, + "etag": "str", + "mimeType": "str", + "properties": { + "str": "str" + }, + "relatedFiles": [ + { + "fileName": "str", + "hashes": { + "str": "str" + }, + "sizeInBytes": 0, + "mimeType": "str", + "properties": { + "str": "str" + }, + "scanDetails": "str", + "scanResult": "str" + } + ], + "scanDetails": "str", + "scanResult": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2429,7 +2537,7 @@ def get_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateFile] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_update_get_file_request( provider=provider, @@ -2463,26 +2571,25 @@ def get_file( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateFile, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_operation_statuses( self, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.UpdateOperation"]: + ) -> ItemPaged[JSON]: """Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete operations are not returned by this API version. @@ -2493,14 +2600,52 @@ def list_operation_statuses( from a collection. The service returns the number of available items up to but not greater than the specified value n. Default value is None. :paramtype top: int - :return: An iterator like instance of UpdateOperation - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.UpdateOperation] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "resourceLocation": "str", + "traceId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.UpdateOperation]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2551,10 +2696,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.UpdateOperation], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2570,11 +2712,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -2588,7 +2726,7 @@ def get_operation_status( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.UpdateOperation: + ) -> JSON: """Retrieve operation status. :param operation_id: Operation identifier. Required. @@ -2598,9 +2736,47 @@ def get_operation_status( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: UpdateOperation. The UpdateOperation is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateOperation + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "resourceLocation": "str", + "traceId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2619,7 +2795,7 @@ def get_operation_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateOperation] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_update_get_operation_status_request( operation_id=operation_id, @@ -2650,11 +2826,7 @@ def get_operation_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After")) @@ -2662,12 +2834,15 @@ def get_operation_status( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateOperation, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore class DeviceManagementOperations: # pylint: disable=too-many-public-methods @@ -2688,7 +2863,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_device_classes(self, *, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.DeviceClass"]: + def list_device_classes(self, *, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged[JSON]: """Gets a list of all device classes (sets of devices compatible with the same updates based on the model Id and compat properties reported in the Device Update PnP interface in IoT Hub) for all devices connected to Device Update for IoT Hub. @@ -2696,14 +2871,41 @@ def list_device_classes(self, *, filter: Optional[str] = None, **kwargs: Any) -> :keyword filter: Restricts the set of device classes returned. You can filter on friendly name. Default value is None. :paramtype filter: str - :return: An iterator like instance of DeviceClass - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.DeviceClass] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceClass]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2753,10 +2955,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceClass], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2772,25 +2971,48 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def get_device_class(self, device_class_id: str, **kwargs: Any) -> _models.DeviceClass: + def get_device_class(self, device_class_id: str, **kwargs: Any) -> JSON: """Gets the properties of a device class. :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2803,7 +3025,7 @@ def get_device_class(self, device_class_id: str, **kwargs: Any) -> _models.Devic _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClass] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_request( device_class_id=device_class_id, @@ -2832,31 +3054,30 @@ def get_device_class(self, device_class_id: str, **kwargs: Any) -> _models.Devic except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClass, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @overload def update_device_class( self, device_class_id: str, - device_class_patch: _models.PatchBody, + device_class_patch: JSON, *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.DeviceClass: + ) -> JSON: """Update device class details. :param device_class_id: Device class identifier. Required. @@ -2864,38 +3085,45 @@ def update_device_class( :param device_class_patch: The device class json merge patch body. Currently only supports patching friendlyName. Required. - :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody + :type device_class_patch: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def update_device_class( - self, - device_class_id: str, - device_class_patch: _types.PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any - ) -> _models.DeviceClass: - """Update device class details. + Example: + .. code-block:: python - :param device_class_id: Device class identifier. Required. - :type device_class_id: str - :param device_class_patch: The device class json merge patch body. Currently only supports - patching - friendlyName. Required. - :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass - :raises ~azure.core.exceptions.HttpResponseError: + # JSON input template you can fill out and use as your body input. + device_class_patch = { + "friendlyName": "str" + } + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ @overload @@ -2906,7 +3134,7 @@ def update_device_class( *, content_type: str = "application/merge-patch+json", **kwargs: Any - ) -> _models.DeviceClass: + ) -> JSON: """Update device class details. :param device_class_id: Device class identifier. Required. @@ -2918,30 +3146,85 @@ def update_device_class( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/merge-patch+json". :paramtype content_type: str - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ @distributed_trace def update_device_class( - self, - device_class_id: str, - device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], - **kwargs: Any - ) -> _models.DeviceClass: + self, device_class_id: str, device_class_patch: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: """Update device class details. :param device_class_id: Device class identifier. Required. :type device_class_id: str :param device_class_patch: The device class json merge patch body. Currently only supports patching - friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. - :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or - ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass + friendlyName. Is either a JSON type or a IO[bytes] type. Required. + :type device_class_patch: JSON or IO[bytes] + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + device_class_patch = { + "friendlyName": "str" + } + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceClassProperties": { + "compatProperties": { + "str": "str" + }, + "contractModel": { + "id": "str", + "name": "str" + } + }, + "bestCompatibleUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "friendlyName": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2955,20 +3238,22 @@ def update_device_class( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeviceClass] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/merge-patch+json" + _json = None _content = None if isinstance(device_class_patch, (IOBase, bytes)): _content = device_class_patch else: - _content = json.dumps(device_class_patch, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = device_class_patch _request = build_device_management_update_device_class_request( device_class_id=device_class_id, instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -2993,21 +3278,20 @@ def update_device_class( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClass, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_device_class( # pylint: disable=inconsistent-return-statements @@ -3060,11 +3344,7 @@ def delete_device_class( # pylint: disable=inconsistent-return-statements if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -3072,19 +3352,33 @@ def delete_device_class( # pylint: disable=inconsistent-return-statements @distributed_trace def list_installable_updates_for_device_class( # pylint: disable=name-too-long self, device_class_id: str, **kwargs: Any - ) -> ItemPaged["_models.UpdateInfo"]: + ) -> ItemPaged[JSON]: """Gets a list of installable updates for a device class. :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: An iterator like instance of UpdateInfo - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.UpdateInfo] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.UpdateInfo]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3134,10 +3428,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.UpdateInfo], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3153,18 +3444,14 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def list_devices(self, *, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.Device"]: + def list_devices(self, *, filter: Optional[str] = None, **kwargs: Any) -> ItemPaged[JSON]: """Gets a list of devices connected to Device Update for IoT Hub. :keyword filter: Restricts the set of devices returned. You can filter on GroupId, @@ -3172,14 +3459,68 @@ def list_devices(self, *, filter: Optional[str] = None, **kwargs: Any) -> ItemPa query for devices with no deployment status (that have never been deployed to). Default value is None. :paramtype filter: str - :return: An iterator like instance of Device - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.Device] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceId": "str", + "onLatestUpdate": bool, + "deploymentStatus": "str", + "groupId": "str", + "installedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastAttemptedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastDeploymentId": "str", + "lastInstallResult": { + "extendedResultCode": 0, + "resultCode": 0, + "resultDetails": "str", + "stepResults": [ + { + "extendedResultCode": 0, + "resultCode": 0, + "description": "str", + "resultDetails": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + ] + }, + "moduleId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Device]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3229,10 +3570,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Device], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3248,17 +3586,13 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) - def _import_devices_initial(self, import_type: Union[str, _models.ImportType], **kwargs: Any) -> Iterator[bytes]: + def _import_devices_initial(self, import_type: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3273,13 +3607,13 @@ def _import_devices_initial(self, import_type: Union[str, _models.ImportType], * content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "application/json")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _content = json.dumps(import_type, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = import_type _request = build_device_management_import_devices_request( instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, - content=_content, + json=_json, headers=_headers, params=_params, ) @@ -3302,11 +3636,7 @@ def _import_devices_initial(self, import_type: Union[str, _models.ImportType], * except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Operation-Location"] = self._deserialize("str", response.headers.get("Operation-Location")) @@ -3314,18 +3644,18 @@ def _import_devices_initial(self, import_type: Union[str, _models.ImportType], * deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(Iterator[bytes], deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(Iterator[bytes], deserialized) # type: ignore @distributed_trace - def begin_import_devices(self, import_type: Union[str, _models.ImportType], **kwargs: Any) -> LROPoller[None]: + def begin_import_devices(self, import_type: str, **kwargs: Any) -> LROPoller[None]: """Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header value to check for operation status. :param import_type: The types of devices to import. Known values are: "Devices", "Modules", and "All". Required. - :type import_type: str or ~azure.iot.deviceupdate.models.ImportType + :type import_type: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3376,15 +3706,69 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def get_device(self, device_id: str, **kwargs: Any) -> _models.Device: + def get_device(self, device_id: str, **kwargs: Any) -> JSON: """Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. :param device_id: Device identifier in Azure IoT Hub. Required. :type device_id: str - :return: Device. The Device is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Device + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceId": "str", + "onLatestUpdate": bool, + "deploymentStatus": "str", + "groupId": "str", + "installedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastAttemptedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastDeploymentId": "str", + "lastInstallResult": { + "extendedResultCode": 0, + "resultCode": 0, + "resultDetails": "str", + "stepResults": [ + { + "extendedResultCode": 0, + "resultCode": 0, + "description": "str", + "resultDetails": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + ] + }, + "moduleId": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3397,7 +3781,7 @@ def get_device(self, device_id: str, **kwargs: Any) -> _models.Device: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Device] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_request( device_id=device_id, @@ -3426,24 +3810,23 @@ def get_device(self, device_id: str, **kwargs: Any) -> _models.Device: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Device, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) -> _models.Device: + def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) -> JSON: """Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub. @@ -3451,9 +3834,63 @@ def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) -> _m :type device_id: str :param module_id: Device module identifier in Azure IoT Hub. Required. :type module_id: str - :return: Device. The Device is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Device + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceId": "str", + "onLatestUpdate": bool, + "deploymentStatus": "str", + "groupId": "str", + "installedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastAttemptedUpdate": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "lastDeploymentId": "str", + "lastInstallResult": { + "extendedResultCode": 0, + "resultCode": 0, + "resultDetails": "str", + "stepResults": [ + { + "extendedResultCode": 0, + "resultCode": 0, + "description": "str", + "resultDetails": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + ] + }, + "moduleId": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3466,7 +3903,7 @@ def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Device] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_module_request( device_id=device_id, @@ -3496,30 +3933,40 @@ def get_device_module(self, device_id: str, module_id: str, **kwargs: Any) -> _m except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Device, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_update_compliance(self, **kwargs: Any) -> _models.UpdateCompliance: + def get_update_compliance(self, **kwargs: Any) -> JSON: """Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates. - :return: UpdateCompliance. The UpdateCompliance is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateCompliance + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "newUpdatesAvailableDeviceCount": 0, + "onLatestUpdateDeviceCount": 0, + "totalDeviceCount": 0, + "updatesInProgressDeviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3532,7 +3979,7 @@ def get_update_compliance(self, **kwargs: Any) -> _models.UpdateCompliance: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateCompliance] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_update_compliance_request( instance_id=self._config.instance_id, @@ -3560,38 +4007,54 @@ def get_update_compliance(self, **kwargs: Any) -> _models.UpdateCompliance: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateCompliance, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_groups(self, *, order_by: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.Group"]: + def list_groups(self, *, order_by: Optional[str] = None, **kwargs: Any) -> ItemPaged[JSON]: """Gets a list of all device groups. The $default group will always be returned first. :keyword order_by: Orders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. Default value is None. :paramtype order_by: str - :return: An iterator like instance of Group - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.Group] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "groupId": "str", + "groupType": "str", + "deployments": [ + "str" + ], + "deviceCount": 0, + "subgroupsWithNewUpdatesAvailableCount": 0, + "subgroupsWithOnLatestUpdateCount": 0, + "subgroupsWithUpdatesInProgressCount": 0 + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Group]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3641,10 +4104,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Group], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3660,25 +4120,38 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def get_group(self, group_id: str, **kwargs: Any) -> _models.Group: + def get_group(self, group_id: str, **kwargs: Any) -> JSON: """Gets the device group properties. :param group_id: Group identifier. Required. :type group_id: str - :return: Group. The Group is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Group + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "groupId": "str", + "groupType": "str", + "deployments": [ + "str" + ], + "deviceCount": 0, + "subgroupsWithNewUpdatesAvailableCount": 0, + "subgroupsWithOnLatestUpdateCount": 0, + "subgroupsWithUpdatesInProgressCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3691,7 +4164,7 @@ def get_group(self, group_id: str, **kwargs: Any) -> _models.Group: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Group] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_group_request( group_id=group_id, @@ -3720,21 +4193,20 @@ def get_group(self, group_id: str, **kwargs: Any) -> _models.Group: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Group, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_group(self, group_id: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements @@ -3785,25 +4257,32 @@ def delete_group(self, group_id: str, **kwargs: Any) -> None: # pylint: disable if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> _models.UpdateCompliance: + def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> JSON: """Get device group update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update. :param group_id: Group identifier. Required. :type group_id: str - :return: UpdateCompliance. The UpdateCompliance is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateCompliance + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "newUpdatesAvailableDeviceCount": 0, + "onLatestUpdateDeviceCount": 0, + "totalDeviceCount": 0, + "updatesInProgressDeviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3816,7 +4295,7 @@ def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateCompliance] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_update_compliance_for_group_request( group_id=group_id, @@ -3845,40 +4324,55 @@ def get_update_compliance_for_group(self, group_id: str, **kwargs: Any) -> _mode except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateCompliance, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_best_updates_for_group( - self, group_id: str, **kwargs: Any - ) -> ItemPaged["_models.DeviceClassSubgroupUpdatableDevices"]: + def list_best_updates_for_group(self, group_id: str, **kwargs: Any) -> ItemPaged[JSON]: """Get the best available updates for a device group and a count of how many devices need each update. :param group_id: Group identifier. Required. :type group_id: str - :return: An iterator like instance of DeviceClassSubgroupUpdatableDevices - :rtype: - ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceCount": 0, + "groupId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceClassSubgroupUpdatableDevices]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3928,10 +4422,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceClassSubgroupUpdatableDevices], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3947,11 +4438,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -3960,7 +4447,7 @@ def get_next(next_link=None): @distributed_trace def list_deployments_for_group( self, group_id: str, *, order_by: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Deployment"]: + ) -> ItemPaged[JSON]: """Gets a list of deployments for a device group. :param group_id: Group identifier. Required. @@ -3968,14 +4455,55 @@ def list_deployments_for_group( :keyword order_by: Orders the set of deployments returned. You can order by start date. Default value is None. :paramtype order_by: str - :return: An iterator like instance of Deployment - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.Deployment] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4026,10 +4554,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Deployment], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4045,27 +4570,64 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.Deployment: + def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Gets the deployment properties. :param group_id: Group identifier. Required. :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4078,7 +4640,7 @@ def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_deployment_request( group_id=group_id, @@ -4108,32 +4670,31 @@ def get_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> _m except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @overload def create_or_update_deployment( self, group_id: str, deployment_id: str, - deployment: _models.Deployment, + deployment: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Deployment: + ) -> JSON: """Creates or updates a deployment. :param group_id: Group identifier. Required. @@ -4141,39 +4702,92 @@ def create_or_update_deployment( :param deployment_id: Deployment identifier. Required. :type deployment_id: str :param deployment: The deployment properties. Required. - :type deployment: ~azure.iot.deviceupdate.models.Deployment + :type deployment: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: _types.Deployment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Deployment: - """Creates or updates a deployment. + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + deployment = { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } - :param group_id: Group identifier. Required. - :type group_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :param deployment: The deployment properties. Required. - :type deployment: ~azure.iot.deviceupdate.types.Deployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment - :raises ~azure.core.exceptions.HttpResponseError: + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ @overload @@ -4185,7 +4799,7 @@ def create_or_update_deployment( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Deployment: + ) -> JSON: """Creates or updates a deployment. :param group_id: Group identifier. Required. @@ -4197,32 +4811,147 @@ def create_or_update_deployment( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ @distributed_trace def create_or_update_deployment( - self, - group_id: str, - deployment_id: str, - deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], - **kwargs: Any - ) -> _models.Deployment: + self, group_id: str, deployment_id: str, deployment: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: """Creates or updates a deployment. :param group_id: Group identifier. Required. :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. + :param deployment: The deployment properties. Is either a JSON type or a IO[bytes] type. Required. - :type deployment: ~azure.iot.deviceupdate.models.Deployment or - ~azure.iot.deviceupdate.types.Deployment or IO[bytes] - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :type deployment: JSON or IO[bytes] + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + deployment = { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4236,14 +4965,15 @@ def create_or_update_deployment( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" + _json = None _content = None if isinstance(deployment, (IOBase, bytes)): _content = deployment else: - _content = json.dumps(deployment, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = deployment _request = build_device_management_create_or_update_deployment_request( group_id=group_id, @@ -4251,6 +4981,7 @@ def create_or_update_deployment( instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -4275,21 +5006,20 @@ def create_or_update_deployment( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_deployment( # pylint: disable=inconsistent-return-statements @@ -4340,17 +5070,13 @@ def delete_deployment( # pylint: disable=inconsistent-return-statements if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: + def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. @@ -4358,9 +5084,60 @@ def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any :type group_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: DeploymentStatus. The DeploymentStatus is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeploymentStatus + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentState": "str", + "groupId": "str", + "subgroupStatus": [ + { + "deploymentState": "str", + "deviceClassId": "str", + "groupId": "str", + "devicesCanceledCount": 0, + "devicesCompletedFailedCount": 0, + "devicesCompletedSucceededCount": 0, + "devicesInProgressCount": 0, + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "totalDevices": 0 + } + ], + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4373,7 +5150,7 @@ def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeploymentStatus] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_deployment_status_request( group_id=group_id, @@ -4403,26 +5180,25 @@ def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeploymentStatus, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_device_class_subgroups_for_group( self, group_id: str, *, filter: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.DeviceClassSubgroup"]: + ) -> ItemPaged[JSON]: """Get the device class subgroups for the group. A device class subgroup is the set of devices within the group that share the same device class. All devices within the same device class are compatible with the same updates. @@ -4433,14 +5209,26 @@ def list_device_class_subgroups_for_group( properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2'). Default value is None. :paramtype filter: str - :return: An iterator like instance of DeviceClassSubgroup - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.DeviceClassSubgroup] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "deviceClassId": "str", + "groupId": "str", + "deploymentId": "str", + "deviceCount": 0 + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceClassSubgroup]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4491,10 +5279,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceClassSubgroup], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4510,20 +5295,14 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def get_device_class_subgroup( - self, group_id: str, device_class_id: str, **kwargs: Any - ) -> _models.DeviceClassSubgroup: + def get_device_class_subgroup(self, group_id: str, device_class_id: str, **kwargs: Any) -> JSON: """Gets device class subgroup details. A device class subgroup is the set of devices within the group that share the same device class. All devices within the same device class are compatible with the same updates. @@ -4532,9 +5311,21 @@ def get_device_class_subgroup( :type group_id: str :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: DeviceClassSubgroup. The DeviceClassSubgroup is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClassSubgroup + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "deviceClassId": "str", + "groupId": "str", + "deploymentId": "str", + "deviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4547,7 +5338,7 @@ def get_device_class_subgroup( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClassSubgroup] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_subgroup_request( group_id=group_id, @@ -4577,21 +5368,20 @@ def get_device_class_subgroup( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClassSubgroup, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_device_class_subgroup( # pylint: disable=inconsistent-return-statements @@ -4647,11 +5437,7 @@ def delete_device_class_subgroup( # pylint: disable=inconsistent-return-stateme if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -4659,7 +5445,7 @@ def delete_device_class_subgroup( # pylint: disable=inconsistent-return-stateme @distributed_trace def get_device_class_subgroup_update_compliance( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, **kwargs: Any - ) -> _models.UpdateCompliance: + ) -> JSON: """Get device class subgroup update compliance information such as how many devices are on their latest update, how many need new updates, and how many are in progress on receiving a new update. @@ -4668,9 +5454,20 @@ def get_device_class_subgroup_update_compliance( # pylint: disable=name-too-lon :type group_id: str :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: UpdateCompliance. The UpdateCompliance is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.UpdateCompliance + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "newUpdatesAvailableDeviceCount": 0, + "onLatestUpdateDeviceCount": 0, + "totalDeviceCount": 0, + "updatesInProgressDeviceCount": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4683,7 +5480,7 @@ def get_device_class_subgroup_update_compliance( # pylint: disable=name-too-lon _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.UpdateCompliance] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_subgroup_update_compliance_request( group_id=group_id, @@ -4713,26 +5510,25 @@ def get_device_class_subgroup_update_compliance( # pylint: disable=name-too-lon except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.UpdateCompliance, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_best_updates_for_device_class_subgroup( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, **kwargs: Any - ) -> _models.DeviceClassSubgroupUpdatableDevices: + ) -> JSON: """Get the best available update for a device class subgroup and a count of how many devices need this update. @@ -4740,10 +5536,28 @@ def get_best_updates_for_device_class_subgroup( # pylint: disable=name-too-long :type group_id: str :param device_class_id: Device class identifier. Required. :type device_class_id: str - :return: DeviceClassSubgroupUpdatableDevices. The DeviceClassSubgroupUpdatableDevices is - compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceClassId": "str", + "deviceCount": 0, + "groupId": "str", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4756,7 +5570,7 @@ def get_best_updates_for_device_class_subgroup( # pylint: disable=name-too-long _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClassSubgroupUpdatableDevices] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_best_updates_for_device_class_subgroup_request( group_id=group_id, @@ -4786,26 +5600,25 @@ def get_best_updates_for_device_class_subgroup( # pylint: disable=name-too-long except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClassSubgroupUpdatableDevices, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_deployments_for_device_class_subgroup( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, *, order_by: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Deployment"]: + ) -> ItemPaged[JSON]: """Gets a list of deployments for a device class subgroup. :param group_id: Group identifier. Required. @@ -4815,14 +5628,55 @@ def list_deployments_for_device_class_subgroup( # pylint: disable=name-too-long :keyword order_by: Orders the set of deployments returned. You can order by start date. Default value is None. :paramtype order_by: str - :return: An iterator like instance of Deployment - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.Deployment] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4874,10 +5728,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.Deployment], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4893,11 +5744,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -4906,7 +5753,7 @@ def get_next(next_link=None): @distributed_trace def get_deployment_for_device_class_subgroup( self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.Deployment: + ) -> JSON: """Gets the deployment properties. :param group_id: Group identifier. Required. @@ -4915,9 +5762,50 @@ def get_deployment_for_device_class_subgroup( :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4930,7 +5818,7 @@ def get_deployment_for_device_class_subgroup( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_deployment_for_device_class_subgroup_request( group_id=group_id, @@ -4961,21 +5849,20 @@ def get_deployment_for_device_class_subgroup( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent-return-statements,name-too-long @@ -5029,19 +5916,13 @@ def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent if response.status_code not in [204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def stop_deployment( - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.Deployment: + def stop_deployment(self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Stops a deployment. :param group_id: Group identifier. Required. @@ -5050,9 +5931,50 @@ def stop_deployment( :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5065,7 +5987,7 @@ def stop_deployment( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_stop_deployment_request( group_id=group_id, @@ -5096,26 +6018,23 @@ def stop_deployment( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def retry_deployment( - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.Deployment: + def retry_deployment(self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any) -> JSON: """Retries a deployment with failed devices. :param group_id: Group identifier. Required. @@ -5124,9 +6043,50 @@ def retry_deployment( :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentId": "str", + "groupId": "str", + "startDateTime": "2020-02-20 00:00:00", + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + }, + "deviceClassSubgroups": [ + "str" + ], + "downloadSecurity": "str", + "isCanceled": bool, + "isCloudInitiatedRollback": bool, + "isRetried": bool, + "rollbackPolicy": { + "failure": { + "devicesFailedCount": 0, + "devicesFailedPercentage": 0 + }, + "update": { + "updateId": { + "name": "str", + "provider": "str", + "version": "str" + }, + "description": "str", + "friendlyName": "str" + } + } + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5139,7 +6099,7 @@ def retry_deployment( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_retry_deployment_request( group_id=group_id, @@ -5170,26 +6130,25 @@ def retry_deployment( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Deployment, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def get_device_class_subgroup_deployment_status( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any - ) -> _models.DeviceClassSubgroupDeploymentStatus: + ) -> JSON: """Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. @@ -5199,10 +6158,39 @@ def get_device_class_subgroup_deployment_status( # pylint: disable=name-too-lon :type device_class_id: str :param deployment_id: Deployment identifier. Required. :type deployment_id: str - :return: DeviceClassSubgroupDeploymentStatus. The DeviceClassSubgroupDeploymentStatus is - compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deploymentState": "str", + "deviceClassId": "str", + "groupId": "str", + "devicesCanceledCount": 0, + "devicesCompletedFailedCount": 0, + "devicesCompletedSucceededCount": 0, + "devicesInProgressCount": 0, + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "totalDevices": 0 + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5215,7 +6203,7 @@ def get_device_class_subgroup_deployment_status( # pylint: disable=name-too-lon _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceClassSubgroupDeploymentStatus] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_device_class_subgroup_deployment_status_request( group_id=group_id, @@ -5246,26 +6234,25 @@ def get_device_class_subgroup_deployment_status( # pylint: disable=name-too-lon except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceClassSubgroupDeploymentStatus, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_device_states_for_device_class_subgroup_deployment( # pylint: disable=name-too-long self, group_id: str, device_class_id: str, deployment_id: str, *, filter: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.DeploymentDeviceState"]: + ) -> ItemPaged[JSON]: """Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. @@ -5278,14 +6265,26 @@ def list_device_states_for_device_class_subgroup_deployment( # pylint: disable= :keyword filter: Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState. Default value is None. :paramtype filter: str - :return: An iterator like instance of DeploymentDeviceState - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.DeploymentDeviceState] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceId": "str", + "deviceState": "str", + "movedOnToNewDeployment": bool, + "retryCount": 0, + "moduleId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeploymentDeviceState]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5338,10 +6337,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeploymentDeviceState], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5357,11 +6353,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -5375,7 +6367,7 @@ def get_operation_status( etag: Optional[str] = None, match_condition: Optional[MatchConditions] = None, **kwargs: Any - ) -> _models.DeviceOperation: + ) -> JSON: """Retrieve operation status. :param operation_id: Operation identifier. Required. @@ -5385,9 +6377,37 @@ def get_operation_status( :paramtype etag: str :keyword match_condition: The match condition to use upon the etag. Default value is None. :paramtype match_condition: ~azure.core.MatchConditions - :return: DeviceOperation. The DeviceOperation is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceOperation + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "traceId": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5406,7 +6426,7 @@ def get_operation_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.DeviceOperation] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_operation_status_request( operation_id=operation_id, @@ -5437,11 +6457,7 @@ def get_operation_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) response_headers = {} response_headers["Retry-After"] = self._deserialize("str", response.headers.get("Retry-After")) @@ -5449,17 +6465,20 @@ def get_operation_status( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.DeviceOperation, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), response_headers) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace def list_operation_statuses( self, *, filter: Optional[str] = None, top: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.DeviceOperation"]: + ) -> ItemPaged[JSON]: """Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. @@ -5470,14 +6489,42 @@ def list_operation_statuses( from a collection. The service returns the number of available items up to but not greater than the specified value n. Default value is None. :paramtype top: int - :return: An iterator like instance of DeviceOperation - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.DeviceOperation] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "2020-02-20 00:00:00", + "lastActionDateTime": "2020-02-20 00:00:00", + "operationId": "str", + "status": "str", + "error": { + "code": "str", + "message": "str", + "details": [ + ... + ], + "innererror": { + "code": "str", + "errorDetail": "str", + "innerError": ..., + "message": "str" + }, + "occurredDateTime": "2020-02-20 00:00:00", + "target": "str" + }, + "etag": "str", + "traceId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceOperation]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5528,10 +6575,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceOperation], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5547,11 +6591,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response @@ -5559,48 +6599,53 @@ def get_next(next_link=None): @overload def start_log_collection( - self, - log_collection_id: str, - log_collection: _models.LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogCollection: + self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> JSON: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str :param log_collection: The log collection properties. Required. - :type log_collection: ~azure.iot.deviceupdate.models.LogCollection + :type log_collection: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: - """ - @overload - def start_log_collection( - self, - log_collection_id: str, - log_collection: _types.LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogCollection: - """Start the device diagnostics log collection on specified devices. + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + log_collection = { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } - :param log_collection_id: Log collection identifier. Required. - :type log_collection_id: str - :param log_collection: The log collection properties. Required. - :type log_collection: ~azure.iot.deviceupdate.types.LogCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection - :raises ~azure.core.exceptions.HttpResponseError: + # response body for status code(s): 201 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ @overload @@ -5611,7 +6656,7 @@ def start_log_collection( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.LogCollection: + ) -> JSON: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. @@ -5621,29 +6666,76 @@ def start_log_collection( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 201 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ @distributed_trace def start_log_collection( - self, - log_collection_id: str, - log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], - **kwargs: Any - ) -> _models.LogCollection: + self, log_collection_id: str, log_collection: Union[JSON, IO[bytes]], **kwargs: Any + ) -> JSON: """Start the device diagnostics log collection on specified devices. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :param log_collection: The log collection properties. Is either a LogCollection type or a - IO[bytes] type. Required. - :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or - ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :param log_collection: The log collection properties. Is either a JSON type or a IO[bytes] + type. Required. + :type log_collection: JSON or IO[bytes] + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # JSON input template you can fill out and use as your body input. + log_collection = { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } + + # response body for status code(s): 201 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5657,20 +6749,22 @@ def start_log_collection( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LogCollection] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) content_type = content_type or "application/json" + _json = None _content = None if isinstance(log_collection, (IOBase, bytes)): _content = log_collection else: - _content = json.dumps(log_collection, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _json = log_collection _request = build_device_management_start_log_collection_request( log_collection_id=log_collection_id, instance_id=self._config.instance_id, content_type=content_type, api_version=self._config.api_version, + json=_json, content=_content, headers=_headers, params=_params, @@ -5695,31 +6789,48 @@ def start_log_collection( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.LogCollection, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> _models.LogCollection: + def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> JSON: """Get the device diagnostics log collection. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5732,7 +6843,7 @@ def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> _models.L _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.LogCollection] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_log_collection_request( log_collection_id=log_collection_id, @@ -5761,34 +6872,51 @@ def get_log_collection(self, log_collection_id: str, **kwargs: Any) -> _models.L except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.LogCollection, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_log_collections(self, **kwargs: Any) -> ItemPaged["_models.LogCollection"]: + def list_log_collections(self, **kwargs: Any) -> ItemPaged[JSON]: """Get all device diagnostics log collections. - :return: An iterator like instance of LogCollection - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.LogCollection] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceList": [ + { + "deviceId": "str", + "moduleId": "str" + } + ], + "createdDateTime": "str", + "description": "str", + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.LogCollection]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5837,10 +6965,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.LogCollection], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -5856,28 +6981,43 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def get_log_collection_detailed_status( - self, log_collection_id: str, **kwargs: Any - ) -> _models.LogCollectionOperationDetailedStatus: + def get_log_collection_detailed_status(self, log_collection_id: str, **kwargs: Any) -> JSON: """Get log collection with detailed status. :param log_collection_id: Log collection identifier. Required. :type log_collection_id: str - :return: LogCollectionOperationDetailedStatus. The LogCollectionOperationDetailedStatus is - compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus + :return: JSON object + :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "createdDateTime": "str", + "description": "str", + "deviceStatus": [ + { + "deviceId": "str", + "status": "str", + "extendedResultCode": "str", + "logLocation": "str", + "moduleId": "str", + "resultCode": "str" + } + ], + "lastActionDateTime": "str", + "operationId": "str", + "status": "str" + } """ error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5890,7 +7030,7 @@ def get_log_collection_detailed_status( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.LogCollectionOperationDetailedStatus] = kwargs.pop("cls", None) + cls: ClsType[JSON] = kwargs.pop("cls", None) _request = build_device_management_get_log_collection_detailed_status_request( log_collection_id=log_collection_id, @@ -5919,37 +7059,53 @@ def get_log_collection_detailed_status( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.LogCollectionOperationDetailedStatus, response.json()) + if response.content: + deserialized = response.json() + else: + deserialized = None if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore - return deserialized # type: ignore + return cast(JSON, deserialized) # type: ignore @distributed_trace - def list_health_of_devices(self, *, filter: str, **kwargs: Any) -> ItemPaged["_models.DeviceHealth"]: + def list_health_of_devices(self, *, filter: str, **kwargs: Any) -> ItemPaged[JSON]: """Get list of device health. :keyword filter: Restricts the set of devices for which device health is returned. You can filter on status, device id and module id. Required. :paramtype filter: str - :return: An iterator like instance of DeviceHealth - :rtype: ~azure.core.paging.ItemPaged[~azure.iot.deviceupdate.models.DeviceHealth] + :return: An iterator like instance of JSON object + :rtype: ~azure.core.paging.ItemPaged[JSON] :raises ~azure.core.exceptions.HttpResponseError: + + Example: + .. code-block:: python + + # response body for status code(s): 200 + response == { + "deviceId": "str", + "healthChecks": [ + { + "name": "str", + "result": "str" + } + ], + "state": "str", + "digitalTwinModelId": "str", + "moduleId": "str" + } """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[list[_models.DeviceHealth]] = kwargs.pop("cls", None) + cls: ClsType[list[JSON]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5999,10 +7155,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - list[_models.DeviceHealth], - deserialized.get("value", []), - ) + list_of_elem = deserialized.get("value", []) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -6018,11 +7171,7 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error) + raise HttpResponseError(response=response) return pipeline_response diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py index 2f3b31fd05e2..87676c65a8f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py @@ -7,41 +7,11 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import Any, Optional, get_args -from azure.core import MatchConditions -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) - -from .._utils.model_base import _is_model __all__: list[str] = [] # Add all objects you want publicly available to users at this package level -def _contains_model(deserializer: Any) -> bool: - if _is_model(deserializer): - return True - return any(_contains_model(argument) for argument in get_args(deserializer)) - - -def _conditional_kwargs(if_none_match: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: - if if_none_match is not None: - kwargs["etag"] = if_none_match - kwargs["match_condition"] = MatchConditions.IfModified - return kwargs - - -def _rename_orderby(orderby: Optional[str], kwargs: dict[str, Any]) -> dict[str, Any]: - kwargs["order_by"] = orderby - return kwargs - - def patch_sdk(): """Do not remove from this file. @@ -49,165 +19,3 @@ def patch_sdk(): you can't accomplish using the techniques described in https://aka.ms/azsdk/python/dpcodegen/python/customize """ - from . import _operations - - update_operations = _operations.DeviceUpdateOperations - management_operations = _operations.DeviceManagementOperations - - generated_deserialize = getattr(_operations, "_deserialize") - - def raw_model_deserialize(deserializer, value, *args, **kwargs): - if _contains_model(deserializer): - return value - return generated_deserialize(deserializer, value, *args, **kwargs) - - setattr(_operations, "_deserialize", raw_model_deserialize) - - get_update = update_operations.get_update - get_file = update_operations.get_file - get_update_operation = update_operations.get_operation_status - list_update_operations = update_operations.list_operation_statuses - - def legacy_get_update(self, provider, name, version, *, if_none_match=None, **kwargs): - return get_update(self, provider, name, version, **_conditional_kwargs(if_none_match, kwargs)) - - def legacy_get_file(self, provider, name, version, file_id, *, if_none_match=None, **kwargs): - return get_file(self, provider, name, version, file_id, **_conditional_kwargs(if_none_match, kwargs)) - - def legacy_get_update_operation(self, operation_id, *, if_none_match=None, **kwargs): - return get_update_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) - - update_operations.get_update = legacy_get_update - update_operations.get_file = legacy_get_file - setattr(update_operations, "get_operation", legacy_get_update_operation) - setattr(update_operations, "list_operations", list_update_operations) - - mappings = { - "get_operation": "get_operation_status", - "list_operations": "list_operation_statuses", - "get_group_update_compliance": "get_update_compliance_for_group", - "get_device_class_subgroup_details": "get_device_class_subgroup", - "list_best_updates_for_device_class_subgroup": "get_best_updates_for_device_class_subgroup", - "delete_device_class_subgroup_deployment": "delete_deployment_for_device_class_subgroup", - "list_devices_for_device_class_subgroup_deployment": "list_device_states_for_device_class_subgroup_deployment", - "collect_logs": "start_log_collection", - "get_log_collection_operation": "get_log_collection", - "list_log_collection_operations": "list_log_collections", - "get_log_collection_operation_detailed_status": "get_log_collection_detailed_status", - "list_device_health": "list_health_of_devices", - } - saved = {old: getattr(management_operations, new) for old, new in mappings.items()} - for old, method in saved.items(): - setattr(management_operations, old, method) - - get_management_operation = saved["get_operation"] - collect_logs = saved["collect_logs"] - get_log_collection = saved["get_log_collection_operation"] - get_log_collection_status = saved["get_log_collection_operation_detailed_status"] - - def legacy_get_management_operation(self, operation_id, *, if_none_match=None, **kwargs): - return get_management_operation(self, operation_id, **_conditional_kwargs(if_none_match, kwargs)) - - setattr(management_operations, "get_operation", legacy_get_management_operation) - - def legacy_collect_logs(self, operation_id, log_collection_request, **kwargs): - return collect_logs(self, operation_id, log_collection_request, **kwargs) - - def legacy_get_log_collection(self, operation_id, **kwargs): - return get_log_collection(self, operation_id, **kwargs) - - def legacy_get_log_collection_status(self, operation_id, **kwargs): - return get_log_collection_status(self, operation_id, **kwargs) - - setattr(management_operations, "collect_logs", legacy_collect_logs) - setattr(management_operations, "get_log_collection_operation", legacy_get_log_collection) - setattr( - management_operations, - "get_log_collection_operation_detailed_status", - legacy_get_log_collection_status, - ) - - list_device_classes = management_operations.list_device_classes - list_groups = management_operations.list_groups - - list_group_deployments = management_operations.list_deployments_for_group - list_subgroup_deployments = management_operations.list_deployments_for_device_class_subgroup - list_best_updates = management_operations.list_best_updates_for_group - - def legacy_list_device_classes(self, **kwargs): - return list_device_classes(self, **kwargs) - - def legacy_list_groups(self, *, orderby=None, **kwargs): - return list_groups(self, **_rename_orderby(orderby, kwargs)) - - def legacy_list_group_deployments(self, group_id, *, orderby=None, **kwargs): - return list_group_deployments(self, group_id, **_rename_orderby(orderby, kwargs)) - - def legacy_list_subgroup_deployments(self, group_id, device_class_id, *, orderby=None, **kwargs): - return list_subgroup_deployments(self, group_id, device_class_id, **_rename_orderby(orderby, kwargs)) - - def legacy_list_best_updates(self, group_id, *, filter=None, **kwargs): - if filter is not None: - params = dict(kwargs.pop("params", {}) or {}) - params["$filter"] = filter - kwargs["params"] = params - return list_best_updates(self, group_id, **kwargs) - - management_operations.list_device_classes = legacy_list_device_classes - management_operations.list_groups = legacy_list_groups - management_operations.list_deployments_for_group = legacy_list_group_deployments - management_operations.list_deployments_for_device_class_subgroup = legacy_list_subgroup_deployments - management_operations.list_best_updates_for_group = legacy_list_best_updates - - def legacy_list_device_health(self, *, filter, **kwargs): - headers = kwargs.pop("headers", {}) or {} - params = kwargs.pop("params", {}) or {} - cls = kwargs.pop("cls", None) - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - request = _operations.build_device_management_list_health_of_devices_request( - instance_id=self._config.instance_id, - filter=filter, - api_version=self._config.api_version, - headers=headers, - params=params, - ) - request.url = self._client.format_url( - request.url, - endpoint=self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - ) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - if response.status_code != 200: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response) - deserialized = response.json() if response.content else None - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - setattr(management_operations, "list_device_health", legacy_list_device_health) - - for operation_name in { - "get_operation_status", - "list_operation_statuses", - "get_update_compliance_for_group", - "get_device_class_subgroup", - "get_best_updates_for_device_class_subgroup", - "delete_deployment_for_device_class_subgroup", - "list_device_states_for_device_class_subgroup_deployment", - "start_log_collection", - "get_log_collection", - "list_log_collections", - "get_log_collection_detailed_status", - "list_health_of_devices", - }: - delattr(management_operations, operation_name) - - delattr(update_operations, "get_operation_status") - delattr(update_operations, "list_operation_statuses") diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py deleted file mode 100644 index c198e1ee1c7c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py +++ /dev/null @@ -1,269 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING, Union -from typing_extensions import Required, TypedDict - -if TYPE_CHECKING: - from .models import DownloadSecurity, OperationStatus - - -class CloudInitiatedRollbackPolicy(TypedDict, total=False): - """Rollback policy for deployment. - - :ivar update_property: Update to rollback to. Required. - :vartype update_property: "UpdateInfo" - :ivar failure: Failure conditions to initiate rollback policy. Required. - :vartype failure: "CloudInitiatedRollbackPolicyFailure" - """ - - update: Required["UpdateInfo"] - """Update to rollback to. Required.""" - failure: Required["CloudInitiatedRollbackPolicyFailure"] - """Failure conditions to initiate rollback policy. Required.""" - - -class CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): - """Failure conditions to initiate rollback policy. - - :ivar devices_failed_percentage: Percentage of devices that failed. Required. - :vartype devices_failed_percentage: int - :ivar devices_failed_count: Number of devices that failed. Required. - :vartype devices_failed_count: int - """ - - devicesFailedPercentage: Required[int] - """Percentage of devices that failed. Required.""" - devicesFailedCount: Required[int] - """Number of devices that failed. Required.""" - - -class Deployment(TypedDict, total=False): - """Deployment metadata. - - :ivar deployment_id: The caller-provided deployment identifier. This cannot be longer than 73 - characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', - '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub - resource generates a GUID for deploymentId when you create a deployment. Required. - :vartype deployment_id: str - :ivar start_date_time: The deployment start datetime. Required. - :vartype start_date_time: str - :ivar update_property: Update information for the update in the deployment. Required. - :vartype update_property: "UpdateInfo" - :ivar group_id: The group identity for the devices the deployment is intended to update. - Required. - :vartype group_id: str - :ivar device_class_subgroups: The device class subgroups the deployment is compatible with and - subgroup deployments have been created for. This is not provided by the caller during - CreateOrUpdateDeployment but is automatically determined by Device Update. - :vartype device_class_subgroups: list[str] - :ivar is_canceled: Boolean flag indicating whether the deployment was canceled. - :vartype is_canceled: bool - :ivar is_retried: Boolean flag indicating whether the deployment has been retried. - :vartype is_retried: bool - :ivar rollback_policy: The rollback policy for the deployment. - :vartype rollback_policy: "CloudInitiatedRollbackPolicy" - :ivar is_cloud_initiated_rollback: Boolean flag indicating whether the deployment is a rollback - deployment. - :vartype is_cloud_initiated_rollback: bool - :ivar download_security: The protocol the device should use when downloading the update - payload. Defaults to "https". Known values are: "https" and "http". - :vartype download_security: Union[str, "DownloadSecurity"] - """ - - deploymentId: Required[str] - """The caller-provided deployment identifier. This cannot be longer than 73 characters, must be - all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, - backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a - GUID for deploymentId when you create a deployment. Required.""" - startDateTime: Required[str] - """The deployment start datetime. Required.""" - update: Required["UpdateInfo"] - """Update information for the update in the deployment. Required.""" - groupId: Required[str] - """The group identity for the devices the deployment is intended to update. Required.""" - deviceClassSubgroups: list[str] - """The device class subgroups the deployment is compatible with and subgroup deployments have been - created for. This is not provided by the caller during CreateOrUpdateDeployment but is - automatically determined by Device Update.""" - isCanceled: bool - """Boolean flag indicating whether the deployment was canceled.""" - isRetried: bool - """Boolean flag indicating whether the deployment has been retried.""" - rollbackPolicy: "CloudInitiatedRollbackPolicy" - """The rollback policy for the deployment.""" - isCloudInitiatedRollback: bool - """Boolean flag indicating whether the deployment is a rollback deployment.""" - downloadSecurity: Union[str, "DownloadSecurity"] - """The protocol the device should use when downloading the update payload. Defaults to \"https\". - Known values are: \"https\" and \"http\".""" - - -class DeviceUpdateAgentId(TypedDict, total=False): - """Device Update agent id. - - :ivar device_id: Device Id. Required. - :vartype device_id: str - :ivar module_id: Module Id. - :vartype module_id: str - """ - - deviceId: Required[str] - """Device Id. Required.""" - moduleId: str - """Module Id.""" - - -class FileImportMetadata(TypedDict, total=False): - """Metadata describing an update file. - - :ivar filename: Update file name as specified inside import manifest. Required. - :vartype filename: str - :ivar url: Azure Blob location from which the update file can be downloaded by Device Update - for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at - least 4 hours. Required. - :vartype url: str - """ - - filename: Required[str] - """Update file name as specified inside import manifest. Required.""" - url: Required[str] - """Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. - This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 - hours. Required.""" - - -class ImportManifestMetadata(TypedDict, total=False): - """Metadata describing the import manifest, a document which describes the files and other - metadata about an update version. - - :ivar url: Azure Blob location from which the import manifest can be downloaded by Device - Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set - to at least 4 hours. Required. - :vartype url: str - :ivar size_in_bytes: File size in number of bytes. Required. - :vartype size_in_bytes: int - :ivar hashes: A JSON object containing the hash(es) of the file. At least SHA256 hash is - required. This object can be thought of as a set of key-value pairs where the key is the hash - algorithm, and the value is the hash of the file calculated using that algorithm. Required. - :vartype hashes: dict[str, str] - """ - - url: Required[str] - """Azure Blob location from which the import manifest can be downloaded by Device Update for IoT - Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 - hours. Required.""" - sizeInBytes: Required[int] - """File size in number of bytes. Required.""" - hashes: Required[dict[str, str]] - """A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This - object can be thought of as a set of key-value pairs where the key is the hash algorithm, and - the value is the hash of the file calculated using that algorithm. Required.""" - - -class ImportUpdateInputItem(TypedDict, total=False): - """Import update input item metadata. - - :ivar import_manifest: Import manifest metadata like source URL, file size/hashes, etc. - Required. - :vartype import_manifest: "ImportManifestMetadata" - :ivar friendly_name: Friendly update name. - :vartype friendly_name: str - :ivar files: One or more update file properties like filename and source URL. - :vartype files: list["FileImportMetadata"] - """ - - importManifest: Required["ImportManifestMetadata"] - """Import manifest metadata like source URL, file size/hashes, etc. Required.""" - friendlyName: str - """Friendly update name.""" - files: list["FileImportMetadata"] - """One or more update file properties like filename and source URL.""" - - -class LogCollection(TypedDict, total=False): - """Diagnostics request body. - - :ivar log_collection_id: The log collection id. - :vartype log_collection_id: str - :ivar device_list: Array of Device Update agent ids. Required. - :vartype device_list: list["DeviceUpdateAgentId"] - :ivar description: Description of the diagnostics operation. - :vartype description: str - :ivar created_date_time: The timestamp when the operation was created. - :vartype created_date_time: str - :ivar last_action_date_time: A timestamp for when the current state was entered. - :vartype last_action_date_time: str - :ivar status: Operation status. Known values are: "NotStarted", "Running", "Succeeded", and - "Failed". - :vartype status: Union[str, "OperationStatus"] - """ - - operationId: str - """The log collection id.""" - deviceList: Required[list["DeviceUpdateAgentId"]] - """Array of Device Update agent ids. Required.""" - description: str - """Description of the diagnostics operation.""" - createdDateTime: str - """The timestamp when the operation was created.""" - lastActionDateTime: str - """A timestamp for when the current state was entered.""" - status: Union[str, "OperationStatus"] - """Operation status. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and \"Failed\".""" - - -class PatchBody(TypedDict, total=False): - """Device Class JSON Merge Patch request body. - - :ivar friendly_name: The device class friendly name. Friendly name can be 1-100 characters, - alphanumeric, dot, and dash. Required. - :vartype friendly_name: str - """ - - friendlyName: Required[str] - """The device class friendly name. Friendly name can be 1-100 characters, alphanumeric, dot, and - dash. Required.""" - - -class UpdateId(TypedDict, total=False): - """Update identifier. - - :ivar provider: Update provider. Required. - :vartype provider: str - :ivar name: Update name. Required. - :vartype name: str - :ivar version: Update version. Required. - :vartype version: str - """ - - provider: Required[str] - """Update provider. Required.""" - name: Required[str] - """Update name. Required.""" - version: Required[str] - """Update version. Required.""" - - -class UpdateInfo(TypedDict, total=False): - """Update information. - - :ivar update_id: Update identifier. Required. - :vartype update_id: "UpdateId" - :ivar description: Update description. - :vartype description: str - :ivar friendly_name: Friendly update name. - :vartype friendly_name: str - """ - - updateId: Required["UpdateId"] - """Update identifier. Required.""" - description: str - """Update description.""" - friendlyName: str - """Friendly update name.""" diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml index f8595069c1f6..8f226eaaef52 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/deviceupdate/data-plane/duiothub -commit: 67ffbb6bee462e36bcdd3b93cffca6942c3a35f7 +commit: a1e083316c4db68aac174e4039aa47c618ba41c1 repo: Azure/azure-rest-api-specs additionalDirectories: From e7f4ab77210b61147ac621034b06b619cd45867d Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Fri, 31 Jul 2026 15:02:47 -0400 Subject: [PATCH 05/11] update changelog --- commit.diff | 2752 +++++++++++++++++ .../azure-iot-deviceupdate/CHANGELOG.md | 11 +- 2 files changed, 2762 insertions(+), 1 deletion(-) create mode 100644 commit.diff diff --git a/commit.diff b/commit.diff new file mode 100644 index 000000000000..899918b54541 --- /dev/null +++ b/commit.diff @@ -0,0 +1,2752 @@ +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +index 2c82bfd62b..992f0a2c7e 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +@@ -1,19 +1,8 @@ + # Release History + +-## 1.1.0 (2026-06-15) ++## 1.1.0 (2026-07-29) + +-### Features Added +- +-- Regenerated client from TypeSpec specification. The library now uses the unified +- `azure.core` HTTP pipeline and shares model infrastructure with other modern +- Azure Python SDKs. +- +-### Other Changes +- +-- Migrated source of truth from Swagger to TypeSpec +- (`specification/deviceupdate/data-plane/duiothub`). +-- Updated minimum required `azure-core` to `1.37.0`. +-- Dropped support for Python 3.8 and 3.9; minimum supported Python is 3.10. ++skip changelog generation for data-plane package and please add changelog manually. + + ## 1.0.0 (2022-09-09) + +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json +index 614a01ddd5..f1a5c7e5f9 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json +@@ -3,9 +3,9 @@ + "apiVersions": { + "DeviceUpdateClient": "2026-06-01" + }, +- "commit": "292231b1131ff9fd070377372a0647c6ac7a6ce2", ++ "commit": "67ffbb6bee462e36bcdd3b93cffca6942c3a35f7", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/deviceupdate/data-plane/duiothub", +- "emitterVersion": "0.63.1", +- "httpClientPythonVersion": "^0.31.1" ++ "emitterVersion": "0.63.3", ++ "httpClientPythonVersion": "^0.34.2" + } +\ No newline at end of file +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.md b/sdk/deviceupdate/azure-iot-deviceupdate/api.md +index 061ec5136e..3df29b42d6 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/api.md ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.md +@@ -1,15 +1,18 @@ + ```py + namespace azure.iot.deviceupdate + +- class azure.iot.deviceupdate.DeviceUpdateClient(DeviceUpdateClientGenerated): implements ContextManager ++ class azure.iot.deviceupdate.DeviceUpdateClient: implements ContextManager ++ device_management: DeviceManagementOperations ++ device_update: DeviceUpdateOperations + + def __init__( + self, + endpoint: str, +- instance_id: str, + credential: TokenCredential, ++ instance_id: str, + *, +- api_version: Optional[str] = ..., ++ api_version: str = ..., ++ polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + +@@ -26,15 +29,18 @@ namespace azure.iot.deviceupdate + + namespace azure.iot.deviceupdate.aio + +- class azure.iot.deviceupdate.aio.DeviceUpdateClient(DeviceUpdateClientGenerated): implements AsyncContextManager ++ class azure.iot.deviceupdate.aio.DeviceUpdateClient: implements AsyncContextManager ++ device_management: DeviceManagementOperations ++ device_update: DeviceUpdateOperations + + def __init__( + self, + endpoint: str, +- instance_id: str, + credential: AsyncTokenCredential, ++ instance_id: str, + *, +- api_version: Optional[str] = ..., ++ api_version: str = ..., ++ polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + +@@ -51,7 +57,7 @@ namespace azure.iot.deviceupdate.aio + + namespace azure.iot.deviceupdate.aio.operations + +- class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): ++ class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations: + + def __init__( + self, +@@ -82,7 +88,7 @@ namespace azure.iot.deviceupdate.aio.operations + self, + group_id: str, + deployment_id: str, +- deployment: JSON, ++ deployment: Deployment, + *, + content_type: str = "application/json", + **kwargs: Any +@@ -239,15 +245,15 @@ namespace azure.iot.deviceupdate.aio.operations + **kwargs: Any + ) -> LogCollectionOperationDetailedStatus: ... + ++ @distributed_trace_async + async def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> DeviceOperation: ... + + @distributed_trace_async + async def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... +@@ -379,7 +385,7 @@ namespace azure.iot.deviceupdate.aio.operations + async def start_log_collection( + self, + log_collection_id: str, +- log_collection: JSON, ++ log_collection: LogCollection, + *, + content_type: str = "application/json", + **kwargs: Any +@@ -418,7 +424,7 @@ namespace azure.iot.deviceupdate.aio.operations + async def update_device_class( + self, + device_class_id: str, +- device_class_patch: JSON, ++ device_class_patch: PatchBody, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any +@@ -435,7 +441,7 @@ namespace azure.iot.deviceupdate.aio.operations + ) -> DeviceClass: ... + + +- class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): ++ class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations: + + def __init__( + self, +@@ -464,7 +470,7 @@ namespace azure.iot.deviceupdate.aio.operations + @overload + async def begin_import_update( + self, +- update_to_import: list[JSON], ++ update_to_import: list[ImportUpdateInputItem], + *, + content_type: str = "application/json", + **kwargs: Any +@@ -479,6 +485,7 @@ namespace azure.iot.deviceupdate.aio.operations + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + ++ @distributed_trace_async + async def get_file( + self, + provider: str, +@@ -487,21 +494,21 @@ namespace azure.iot.deviceupdate.aio.operations + file_id: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> UpdateFile: ... + ++ @distributed_trace_async + async def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> UpdateOperation: ... + ++ @distributed_trace_async + async def get_update( + self, + provider: str, +@@ -509,10 +516,9 @@ namespace azure.iot.deviceupdate.aio.operations + version: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> Update: ... + + @distributed_trace + def list_files( +@@ -1470,7 +1476,7 @@ namespace azure.iot.deviceupdate.models + + namespace azure.iot.deviceupdate.operations + +- class azure.iot.deviceupdate.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): ++ class azure.iot.deviceupdate.operations.DeviceManagementOperations: + + def __init__( + self, +@@ -1501,7 +1507,7 @@ namespace azure.iot.deviceupdate.operations + self, + group_id: str, + deployment_id: str, +- deployment: JSON, ++ deployment: Deployment, + *, + content_type: str = "application/json", + **kwargs: Any +@@ -1658,15 +1664,15 @@ namespace azure.iot.deviceupdate.operations + **kwargs: Any + ) -> LogCollectionOperationDetailedStatus: ... + ++ @distributed_trace + def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> DeviceOperation: ... + + @distributed_trace + def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... +@@ -1798,7 +1804,7 @@ namespace azure.iot.deviceupdate.operations + def start_log_collection( + self, + log_collection_id: str, +- log_collection: JSON, ++ log_collection: LogCollection, + *, + content_type: str = "application/json", + **kwargs: Any +@@ -1837,7 +1843,7 @@ namespace azure.iot.deviceupdate.operations + def update_device_class( + self, + device_class_id: str, +- device_class_patch: JSON, ++ device_class_patch: PatchBody, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any +@@ -1854,7 +1860,7 @@ namespace azure.iot.deviceupdate.operations + ) -> DeviceClass: ... + + +- class azure.iot.deviceupdate.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): ++ class azure.iot.deviceupdate.operations.DeviceUpdateOperations: + + def __init__( + self, +@@ -1883,7 +1889,7 @@ namespace azure.iot.deviceupdate.operations + @overload + def begin_import_update( + self, +- update_to_import: list[JSON], ++ update_to_import: list[ImportUpdateInputItem], + *, + content_type: str = "application/json", + **kwargs: Any +@@ -1898,6 +1904,7 @@ namespace azure.iot.deviceupdate.operations + **kwargs: Any + ) -> LROPoller[None]: ... + ++ @distributed_trace + def get_file( + self, + provider: str, +@@ -1906,21 +1913,21 @@ namespace azure.iot.deviceupdate.operations + file_id: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> UpdateFile: ... + ++ @distributed_trace + def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> UpdateOperation: ... + ++ @distributed_trace + def get_update( + self, + provider: str, +@@ -1928,10 +1935,9 @@ namespace azure.iot.deviceupdate.operations + version: str, + *, + etag: Optional[str] = ..., +- if_none_match: Optional[str] = ..., + match_condition: Optional[MatchConditions] = ..., + **kwargs: Any +- ): ... ++ ) -> Update: ... + + @distributed_trace + def list_files( +@@ -1981,4 +1987,112 @@ namespace azure.iot.deviceupdate.operations + ) -> ItemPaged[str]: ... + + ++namespace azure.iot.deviceupdate.types ++ ++ class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicy(TypedDict, total=False): ++ key "failure": Required[CloudInitiatedRollbackPolicyFailure] ++ key "update": Required[UpdateInfo] ++ failure: CloudInitiatedRollbackPolicyFailure ++ update_property: UpdateInfo ++ ++ ++ class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): ++ key "devicesFailedCount": Required[int] ++ key "devicesFailedPercentage": Required[int] ++ devices_failed_count: int ++ devices_failed_percentage: int ++ ++ ++ class azure.iot.deviceupdate.types.Deployment(TypedDict, total=False): ++ key "deploymentId": Required[str] ++ key "downloadSecurity": Union[str, DownloadSecurity] ++ key "groupId": Required[str] ++ key "isCanceled": bool ++ key "isCloudInitiatedRollback": bool ++ key "isRetried": bool ++ key "rollbackPolicy": ForwardRef('CloudInitiatedRollbackPolicy', module='types') ++ key "startDateTime": Required[str] ++ key "update": Required[UpdateInfo] ++ deployment_id: str ++ deviceClassSubgroups: list[str] ++ device_class_subgroups: list[str] ++ download_security: Union[str, DownloadSecurity] ++ group_id: str ++ is_canceled: bool ++ is_cloud_initiated_rollback: bool ++ is_retried: bool ++ rollback_policy: CloudInitiatedRollbackPolicy ++ start_date_time: str ++ update_property: UpdateInfo ++ ++ ++ class azure.iot.deviceupdate.types.DeviceUpdateAgentId(TypedDict, total=False): ++ key "deviceId": Required[str] ++ key "moduleId": str ++ device_id: str ++ module_id: str ++ ++ ++ class azure.iot.deviceupdate.types.FileImportMetadata(TypedDict, total=False): ++ key "filename": Required[str] ++ key "url": Required[str] ++ filename: str ++ url: str ++ ++ ++ class azure.iot.deviceupdate.types.ImportManifestMetadata(TypedDict, total=False): ++ key "hashes": Required[dict[str, str]] ++ key "sizeInBytes": Required[int] ++ key "url": Required[str] ++ hashes: dict[str, str] ++ size_in_bytes: int ++ url: str ++ ++ ++ class azure.iot.deviceupdate.types.ImportUpdateInputItem(TypedDict, total=False): ++ key "friendlyName": str ++ key "importManifest": Required[ImportManifestMetadata] ++ files: list[FileImportMetadata] ++ friendly_name: str ++ import_manifest: ImportManifestMetadata ++ ++ ++ class azure.iot.deviceupdate.types.LogCollection(TypedDict, total=False): ++ key "createdDateTime": str ++ key "description": str ++ key "deviceList": Required[list[DeviceUpdateAgentId]] ++ key "lastActionDateTime": str ++ key "operationId": str ++ key "status": Union[str, OperationStatus] ++ created_date_time: str ++ description: str ++ device_list: list[DeviceUpdateAgentId] ++ last_action_date_time: str ++ log_collection_id: str ++ status: Union[str, OperationStatus] ++ ++ ++ class azure.iot.deviceupdate.types.PatchBody(TypedDict, total=False): ++ key "friendlyName": Required[str] ++ friendly_name: str ++ ++ ++ class azure.iot.deviceupdate.types.UpdateId(TypedDict, total=False): ++ key "name": Required[str] ++ key "provider": Required[str] ++ key "version": Required[str] ++ name: str ++ provider: str ++ version: str ++ ++ ++ class azure.iot.deviceupdate.types.UpdateInfo(TypedDict, total=False): ++ key "description": str ++ key "friendlyName": str ++ key "updateId": Required[UpdateId] ++ description: str ++ friendly_name: str ++ update_id: UpdateId ++ ++ + ``` +\ No newline at end of file +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml +index 408933ae1c..a4a121bbf9 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml +@@ -1,3 +1,3 @@ +-apiMdSha256: 555c6332bae64960b1565938ed0453aac0b22874c60b4c3c7ed0d8de8156c371 +-parserVersion: 0.3.28 +-pythonVersion: 3.13.12 ++apiMdSha256: e6da310dba4ea5263163ad432f276371b3025fcca87680847e130581a6157980 ++parserVersion: 0.3.30 ++pythonVersion: 3.13.14 +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json +index 5d72b7c262..d5edd1a085 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json +@@ -51,106 +51,106 @@ + "azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState": "DeviceUpdateClient.DeviceClassSubgroupDeploymentState", + "azure.iot.deviceupdate.models.DeviceHealthState": "DeviceUpdateClient.DeviceHealthState", + "azure.iot.deviceupdate.models.HealthCheckResult": "DeviceUpdateClient.HealthCheckResult", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_import_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_delete_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_delete_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_providers": "DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_providers": "DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_names": "DeviceUpdateClient.DeviceUpdateOperationGroup.listNames", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_names": "DeviceUpdateClient.DeviceUpdateOperationGroup.listNames", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_versions": "DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_versions": "DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_files": "DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "DeviceUpdateClient.DeviceUpdateOperationGroup.getFile", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "DeviceUpdateClient.DeviceUpdateOperationGroup.getFile", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses", +- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus", +- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.update_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.update_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listDevices", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listDevices", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.begin_import_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.importDevices", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.begin_import_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.importDevices", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device": "DeviceUpdateClient.DeviceManagementOperationGroup.getDevice", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device": "DeviceUpdateClient.DeviceManagementOperationGroup.getDevice", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_module": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_module": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_groups": "DeviceUpdateClient.DeviceManagementOperationGroup.listGroups", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_groups": "DeviceUpdateClient.DeviceManagementOperationGroup.listGroups", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getGroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getGroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.create_or_update_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.create_or_update_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment", +- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup", +- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup" ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.getUpdate", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.getUpdate", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_delete_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.deleteUpdate", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_delete_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.deleteUpdate", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_providers": "Customization.ClientDeviceUpdateService.DeviceUpdate.listProviders", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_providers": "Customization.ClientDeviceUpdateService.DeviceUpdate.listProviders", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_names": "Customization.ClientDeviceUpdateService.DeviceUpdate.listNames", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_names": "Customization.ClientDeviceUpdateService.DeviceUpdate.listNames", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_versions": "Customization.ClientDeviceUpdateService.DeviceUpdate.listVersions", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_versions": "Customization.ClientDeviceUpdateService.DeviceUpdate.listVersions", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", ++ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", ++ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.update_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.updateDeviceClass", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.update_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.updateDeviceClass", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClass", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClass", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.listInstallableUpdatesForDeviceClass", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.listInstallableUpdatesForDeviceClass", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listDevices", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listDevices", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.begin_import_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.importDevices", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.begin_import_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.importDevices", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device": "Customization.ClientDeviceUpdateService.DeviceManagement.getDevice", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device": "Customization.ClientDeviceUpdateService.DeviceManagement.getDevice", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_module": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceModule", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_module": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceModule", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateCompliance", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateCompliance", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_groups": "Customization.ClientDeviceUpdateService.DeviceManagement.listGroups", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_groups": "Customization.ClientDeviceUpdateService.DeviceManagement.listGroups", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeployment", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeployment", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.create_or_update_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.createOrUpdateDeployment", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.create_or_update_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.createOrUpdateDeployment", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeployment", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeployment", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", ++ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices", ++ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices" + }, +- "CrossLanguageVersion": "2152dadbc310" ++ "CrossLanguageVersion": "c1a73ac75a65" + } +\ No newline at end of file +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py +index c696364981..0b2f1892b1 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py +@@ -28,12 +28,7 @@ if TYPE_CHECKING: + + + class DeviceUpdateClient: +- """Device Update for IoT Hub is an Azure service that enables customers to publish updates for +- their IoT devices to the cloud, and then deploy that update to their devices (approve updates +- to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and +- reliability of the Windows Update platform, optimized for IoT devices. It works globally and +- knows when and how to update devices, enabling customers to focus on their business goals and +- let Device Update for IoT Hub handle the updates. ++ """DeviceUpdateClient. + + :ivar device_update: DeviceUpdateOperations operations + :vartype device_update: azure.iot.deviceupdate.operations.DeviceUpdateOperations +@@ -107,7 +102,7 @@ class DeviceUpdateClient: + + request_copy = deepcopy(request) + path_format_arguments = { +- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), ++ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py +index f3dc84c614..2431c67afc 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py +@@ -29,9 +29,9 @@ class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attr + :type credential: ~azure.core.credentials.TokenCredential + :param instance_id: The Device Update for IoT Hub account instance identifier. Required. + :type instance_id: str +- :keyword api_version: The API version to use for this operation. Known values are "2026-06-01". +- Default value is "2026-06-01". Note that overriding this default value may result in unsupported +- behavior. ++ :keyword api_version: The API version to use for this operation. Known values are "2026-06-01" ++ and None. Default value is None. If not set, the operation's default API version will be used. ++ Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +index 2485462aff..87676c65a8 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +@@ -8,48 +8,8 @@ + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize + """ + +-from typing import Any, List, Optional, TYPE_CHECKING + +-from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated +- +-if TYPE_CHECKING: +- from azure.core.credentials import TokenCredential +- +- +-class DeviceUpdateClient(DeviceUpdateClientGenerated): +- """Device Update for IoT Hub client. +- +- This override preserves the constructor parameter order shipped in 1.0.0 +- (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client +- orders the hoisted ``instance_id`` after ``credential``; restoring the original +- order here avoids a breaking change for existing callers. +- +- :param endpoint: The Device Update for IoT Hub account endpoint. Required. +- :type endpoint: str +- :param instance_id: The Device Update for IoT Hub account instance identifier. Required. +- :type instance_id: str +- :param credential: Credential used to authenticate requests to the service. Required. +- :type credential: ~azure.core.credentials.TokenCredential +- :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". +- Note that overriding this default value may result in unsupported behavior. +- :paramtype api_version: str +- """ +- +- def __init__( +- self, +- endpoint: str, +- instance_id: str, +- credential: "TokenCredential", +- *, +- api_version: Optional[str] = None, +- **kwargs: Any, +- ) -> None: +- if api_version is not None: +- kwargs["api_version"] = api_version +- super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) +- +- +-__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level ++__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + + def patch_sdk(): +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py +index bd5b9caf10..1934415c13 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py +@@ -109,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + return encoded + + ++def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): ++ """Serialize a timedelta to its wire representation. ++ ++ For the ``seconds``/``milliseconds`` encodings the value is converted to a ++ numeric value, otherwise it falls back to an ISO 8601 duration string. ++ ++ :param timedelta td: The timedelta to serialize. ++ :param str format: The duration encoding format. ++ :rtype: int or float or str ++ :return: serialized duration ++ """ ++ seconds = td.total_seconds() ++ if format == "duration-seconds-int": ++ return int(seconds) ++ if format == "duration-seconds-float": ++ return seconds ++ if format == "duration-milliseconds-int": ++ return int(seconds * 1000) ++ if format == "duration-milliseconds-float": ++ return seconds * 1000 ++ return _timedelta_as_isostr(td) ++ ++ + def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": +@@ -301,6 +324,12 @@ def _deserialize_duration(attr): + return isodate.parse_duration(attr) + + ++def _deserialize_duration_numeric(attr, unit): ++ if isinstance(attr, timedelta): ++ return attr ++ return timedelta(**{unit: float(attr)}) ++ ++ + def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr +@@ -330,6 +359,10 @@ _DESERIALIZE_MAPPING_WITHFORMAT = { + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, ++ "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), ++ "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), ++ "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), ++ "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + } + + +@@ -425,21 +458,21 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): + + def keys(self) -> typing.KeysView[str]: + """ +- :returns: a set-like object providing a view on D's keys ++ :returns: a set-like object providing a view on the mapping's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ +- :returns: an object providing a view on D's values ++ :returns: an object providing a view on the mapping's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ +- :returns: set-like object providing a view on D's items ++ :returns: a set-like object providing a view on the mapping's items + :rtype: ~typing.ItemsView + """ + return self._data.items() +@@ -449,7 +482,7 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None +- :returns: D[k] if k in D, else d. ++ :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + try: +@@ -484,19 +517,19 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple +- :raises KeyError: if D is empty. ++ :raises KeyError: if the dictionary is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ +- Remove all items from D. ++ Remove all items from the dictionary. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ +- Updates D from mapping/iterable E and F. ++ Update the dictionary from a mapping or an iterable of key-value pairs. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) +@@ -509,10 +542,11 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ +- Same as calling D.get(k, d), and setting D[k]=d if k not found ++ Return the value for key if key is in the dictionary; otherwise set the key to ++ default and return default. + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary +- :returns: D[k] if k in D, else d. ++ :returns: The value for key if key is in the dictionary, else default. + :rtype: any + """ + if default is _UNSET: +@@ -564,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m + pass + # Last, try datetime.timedelta + try: +- return _timedelta_as_isostr(o) ++ return _serialize_duration(o, format) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py +index a088671e9c..75906e2eb7 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py +@@ -520,6 +520,10 @@ class Serializer: # pylint: disable=too-many-public-methods + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, ++ "duration-seconds-int": Serializer.serialize_duration_seconds_int, ++ "duration-seconds-float": Serializer.serialize_duration_seconds_float, ++ "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, ++ "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, +@@ -1109,6 +1113,61 @@ class Serializer: # pylint: disable=too-many-public-methods + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + ++ @staticmethod ++ def _serialize_duration_numeric(attr, scale, as_int): ++ """Serialize a TimeDelta into a numeric value scaled to the wire unit. ++ ++ :param TimeDelta attr: Object to be serialized. ++ :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). ++ :param bool as_int: Whether to truncate the result to an int. ++ :rtype: int or float ++ :return: serialized duration ++ """ ++ if isinstance(attr, str): ++ attr = isodate.parse_duration(attr) ++ value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr ++ return int(value) if as_int else float(value) ++ ++ @staticmethod ++ def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument ++ """Serialize TimeDelta object into an integer number of seconds. ++ ++ :param TimeDelta attr: Object to be serialized. ++ :rtype: int ++ :return: serialized duration ++ """ ++ return Serializer._serialize_duration_numeric(attr, 1, True) ++ ++ @staticmethod ++ def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument ++ """Serialize TimeDelta object into a floating point number of seconds. ++ ++ :param TimeDelta attr: Object to be serialized. ++ :rtype: float ++ :return: serialized duration ++ """ ++ return Serializer._serialize_duration_numeric(attr, 1, False) ++ ++ @staticmethod ++ def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument ++ """Serialize TimeDelta object into an integer number of milliseconds. ++ ++ :param TimeDelta attr: Object to be serialized. ++ :rtype: int ++ :return: serialized duration ++ """ ++ return Serializer._serialize_duration_numeric(attr, 1000, True) ++ ++ @staticmethod ++ def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument ++ """Serialize TimeDelta object into a floating point number of milliseconds. ++ ++ :param TimeDelta attr: Object to be serialized. ++ :rtype: float ++ :return: serialized duration ++ """ ++ return Serializer._serialize_duration_numeric(attr, 1000, False) ++ + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. +@@ -1381,6 +1440,10 @@ class Deserializer: + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, ++ "duration-seconds-int": Deserializer.deserialize_duration_seconds, ++ "duration-seconds-float": Deserializer.deserialize_duration_seconds, ++ "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, ++ "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, +@@ -1393,6 +1456,10 @@ class Deserializer: + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), ++ "duration-seconds-int": (isodate.Duration, datetime.timedelta), ++ "duration-seconds-float": (isodate.Duration, datetime.timedelta), ++ "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), ++ "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: dict[str, type] = dict(classes) if classes else {} +@@ -1954,6 +2021,48 @@ class Deserializer: + raise DeserializationError(msg) from err + return duration + ++ @staticmethod ++ def _deserialize_duration_numeric(attr, unit): ++ """Deserialize a numeric duration value into a TimeDelta object. ++ ++ :param float attr: response value to be deserialized. ++ :param str unit: The wire unit, used as the ``timedelta`` keyword ++ (``"seconds"`` or ``"milliseconds"``). ++ :return: Deserialized duration ++ :rtype: TimeDelta ++ :raises DeserializationError: if value is invalid. ++ """ ++ if isinstance(attr, ET.Element): ++ attr = attr.text ++ try: ++ duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore ++ except (ValueError, OverflowError, TypeError) as err: ++ msg = "Cannot deserialize duration object." ++ raise DeserializationError(msg) from err ++ return duration ++ ++ @staticmethod ++ def deserialize_duration_seconds(attr): ++ """Deserialize a numeric number of seconds into a TimeDelta object. ++ ++ :param float attr: response value to be deserialized. ++ :return: Deserialized duration ++ :rtype: TimeDelta ++ :raises DeserializationError: if value is invalid. ++ """ ++ return Deserializer._deserialize_duration_numeric(attr, "seconds") ++ ++ @staticmethod ++ def deserialize_duration_milliseconds(attr): ++ """Deserialize a numeric number of milliseconds into a TimeDelta object. ++ ++ :param float attr: response value to be deserialized. ++ :return: Deserialized duration ++ :rtype: TimeDelta ++ :raises DeserializationError: if value is invalid. ++ """ ++ return Deserializer._deserialize_duration_numeric(attr, "milliseconds") ++ + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py +index 0d79358c1d..a9f9801b41 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py +@@ -28,12 +28,7 @@ if TYPE_CHECKING: + + + class DeviceUpdateClient: +- """Device Update for IoT Hub is an Azure service that enables customers to publish updates for +- their IoT devices to the cloud, and then deploy that update to their devices (approve updates +- to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and +- reliability of the Windows Update platform, optimized for IoT devices. It works globally and +- knows when and how to update devices, enabling customers to focus on their business goals and +- let Device Update for IoT Hub handle the updates. ++ """DeviceUpdateClient. + + :ivar device_update: DeviceUpdateOperations operations + :vartype device_update: azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations +@@ -109,7 +104,7 @@ class DeviceUpdateClient: + + request_copy = deepcopy(request) + path_format_arguments = { +- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), ++ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py +index 4ba8e0abc8..39d2645ab5 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py +@@ -29,9 +29,9 @@ class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attr + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param instance_id: The Device Update for IoT Hub account instance identifier. Required. + :type instance_id: str +- :keyword api_version: The API version to use for this operation. Known values are "2026-06-01". +- Default value is "2026-06-01". Note that overriding this default value may result in unsupported +- behavior. ++ :keyword api_version: The API version to use for this operation. Known values are "2026-06-01" ++ and None. Default value is None. If not set, the operation's default API version will be used. ++ Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +index 73feb5caa7..87676c65a8 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +@@ -8,48 +8,8 @@ + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize + """ + +-from typing import Any, List, Optional, TYPE_CHECKING + +-from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated +- +-if TYPE_CHECKING: +- from azure.core.credentials_async import AsyncTokenCredential +- +- +-class DeviceUpdateClient(DeviceUpdateClientGenerated): +- """Device Update for IoT Hub async client. +- +- This override preserves the constructor parameter order shipped in 1.0.0 +- (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client +- orders the hoisted ``instance_id`` after ``credential``; restoring the original +- order here avoids a breaking change for existing callers. +- +- :param endpoint: The Device Update for IoT Hub account endpoint. Required. +- :type endpoint: str +- :param instance_id: The Device Update for IoT Hub account instance identifier. Required. +- :type instance_id: str +- :param credential: Credential used to authenticate requests to the service. Required. +- :type credential: ~azure.core.credentials_async.AsyncTokenCredential +- :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". +- Note that overriding this default value may result in unsupported behavior. +- :paramtype api_version: str +- """ +- +- def __init__( +- self, +- endpoint: str, +- instance_id: str, +- credential: "AsyncTokenCredential", +- *, +- api_version: Optional[str] = None, +- **kwargs: Any, +- ) -> None: +- if api_version is not None: +- kwargs["api_version"] = api_version +- super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) +- +- +-__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level ++__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + + def patch_sdk(): +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py +index 47aaedcfd5..72351924fa 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py +@@ -33,7 +33,7 @@ from azure.core.tracing.decorator import distributed_trace + from azure.core.tracing.decorator_async import distributed_trace_async + from azure.core.utils import case_insensitive_dict + +-from ... import models as _models ++from ... import models as _models, types as _types + from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize + from ..._utils.serialization import Deserializer, Serializer + from ...operations._operations import ( +@@ -90,7 +90,6 @@ from ...operations._operations import ( + ) + from .._configuration import DeviceUpdateClientConfiguration + +-JSON = MutableMapping[str, Any] + T = TypeVar("T") + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] + +@@ -210,7 +209,9 @@ class DeviceUpdateOperations: + return AsyncItemPaged(get_next, extract_data) + + async def _import_update_initial( +- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any ++ self, ++ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], ++ **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, +@@ -305,7 +306,11 @@ class DeviceUpdateOperations: + + @overload + async def begin_import_update( +- self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any ++ self, ++ update_to_import: list[_types.ImportUpdateInputItem], ++ *, ++ content_type: str = "application/json", ++ **kwargs: Any + ) -> AsyncLROPoller[None]: + """Import new update version. This is a long-running-operation; use Operation-Location response + header value to check for operation status. +@@ -314,7 +319,7 @@ class DeviceUpdateOperations: + `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json + `_ for + details). Required. +- :type update_to_import: list[JSON] ++ :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str +@@ -345,7 +350,9 @@ class DeviceUpdateOperations: + + @distributed_trace_async + async def begin_import_update( +- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any ++ self, ++ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], ++ **kwargs: Any + ) -> AsyncLROPoller[None]: + """Import new update version. This is a long-running-operation; use Operation-Location response + header value to check for operation status. +@@ -353,9 +360,9 @@ class DeviceUpdateOperations: + :param update_to_import: The update to be imported (see schema + `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json + `_ for +- details). Is one of the following types: [ImportUpdateInputItem], [JSON], IO[bytes] Required. ++ details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. + :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or +- list[JSON] or IO[bytes] ++ list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: +@@ -1498,7 +1505,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + async def update_device_class( + self, + device_class_id: str, +- device_class_patch: JSON, ++ device_class_patch: _types.PatchBody, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any +@@ -1510,7 +1517,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :param device_class_patch: The device class json merge patch body. Currently only supports + patching + friendlyName. Required. +- :type device_class_patch: JSON ++ :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str +@@ -1546,7 +1553,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @distributed_trace_async + async def update_device_class( +- self, device_class_id: str, device_class_patch: Union[_models.PatchBody, JSON, IO[bytes]], **kwargs: Any ++ self, ++ device_class_id: str, ++ device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], ++ **kwargs: Any + ) -> _models.DeviceClass: + """Update device class details. + +@@ -1554,8 +1564,9 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :type device_class_id: str + :param device_class_patch: The device class json merge patch body. Currently only supports + patching +- friendlyName. Is one of the following types: PatchBody, JSON, IO[bytes] Required. +- :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or JSON or IO[bytes] ++ friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. ++ :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or ++ ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] + :return: DeviceClass. The DeviceClass is compatible with MutableMapping + :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :raises ~azure.core.exceptions.HttpResponseError: +@@ -2775,7 +2786,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + self, + group_id: str, + deployment_id: str, +- deployment: JSON, ++ deployment: _types.Deployment, + *, + content_type: str = "application/json", + **kwargs: Any +@@ -2787,7 +2798,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str + :param deployment: The deployment properties. Required. +- :type deployment: JSON ++ :type deployment: ~azure.iot.deviceupdate.types.Deployment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str +@@ -2824,7 +2835,11 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @distributed_trace_async + async def create_or_update_deployment( +- self, group_id: str, deployment_id: str, deployment: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any ++ self, ++ group_id: str, ++ deployment_id: str, ++ deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], ++ **kwargs: Any + ) -> _models.Deployment: + """Creates or updates a deployment. + +@@ -2832,9 +2847,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :type group_id: str + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str +- :param deployment: The deployment properties. Is one of the following types: Deployment, JSON, +- IO[bytes] Required. +- :type deployment: ~azure.iot.deviceupdate.models.Deployment or JSON or IO[bytes] ++ :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. ++ Required. ++ :type deployment: ~azure.iot.deviceupdate.models.Deployment or ++ ~azure.iot.deviceupdate.types.Deployment or IO[bytes] + :return: Deployment. The Deployment is compatible with MutableMapping + :rtype: ~azure.iot.deviceupdate.models.Deployment + :raises ~azure.core.exceptions.HttpResponseError: +@@ -2906,6 +2922,62 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + return deserialized # type: ignore + ++ @distributed_trace_async ++ async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> None: ++ """Deletes a deployment. ++ ++ :param group_id: Group identifier. Required. ++ :type group_id: str ++ :param deployment_id: Deployment identifier. Required. ++ :type deployment_id: str ++ :return: None ++ :rtype: None ++ :raises ~azure.core.exceptions.HttpResponseError: ++ """ ++ error_map: MutableMapping = { ++ 401: ClientAuthenticationError, ++ 404: ResourceNotFoundError, ++ 409: ResourceExistsError, ++ 304: ResourceNotModifiedError, ++ } ++ error_map.update(kwargs.pop("error_map", {}) or {}) ++ ++ _headers = kwargs.pop("headers", {}) or {} ++ _params = kwargs.pop("params", {}) or {} ++ ++ cls: ClsType[None] = kwargs.pop("cls", None) ++ ++ _request = build_device_management_delete_deployment_request( ++ group_id=group_id, ++ deployment_id=deployment_id, ++ instance_id=self._config.instance_id, ++ api_version=self._config.api_version, ++ headers=_headers, ++ params=_params, ++ ) ++ path_format_arguments = { ++ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), ++ } ++ _request.url = self._client.format_url(_request.url, **path_format_arguments) ++ ++ _stream = False ++ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access ++ _request, stream=_stream, **kwargs ++ ) ++ ++ response = pipeline_response.http_response ++ ++ if response.status_code not in [204]: ++ map_error(status_code=response.status_code, response=response, error_map=error_map) ++ error = _failsafe_deserialize( ++ _models.ErrorResponse, ++ response, ++ ) ++ raise HttpResponseError(response=response, model=error) ++ ++ if cls: ++ return cls(pipeline_response, None, {}) # type: ignore ++ + @distributed_trace_async + async def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: + """Gets the status of a deployment including a breakdown of how many devices in the deployment are +@@ -3533,6 +3605,67 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + return deserialized # type: ignore + ++ @distributed_trace_async ++ async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-too-long ++ self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any ++ ) -> None: ++ """Deletes a device class subgroup deployment. ++ ++ :param group_id: Group identifier. Required. ++ :type group_id: str ++ :param device_class_id: Device class identifier. Required. ++ :type device_class_id: str ++ :param deployment_id: Deployment identifier. Required. ++ :type deployment_id: str ++ :return: None ++ :rtype: None ++ :raises ~azure.core.exceptions.HttpResponseError: ++ """ ++ error_map: MutableMapping = { ++ 401: ClientAuthenticationError, ++ 404: ResourceNotFoundError, ++ 409: ResourceExistsError, ++ 304: ResourceNotModifiedError, ++ } ++ error_map.update(kwargs.pop("error_map", {}) or {}) ++ ++ _headers = kwargs.pop("headers", {}) or {} ++ _params = kwargs.pop("params", {}) or {} ++ ++ cls: ClsType[None] = kwargs.pop("cls", None) ++ ++ _request = build_device_management_delete_deployment_for_device_class_subgroup_request( ++ group_id=group_id, ++ device_class_id=device_class_id, ++ deployment_id=deployment_id, ++ instance_id=self._config.instance_id, ++ api_version=self._config.api_version, ++ headers=_headers, ++ params=_params, ++ ) ++ path_format_arguments = { ++ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), ++ } ++ _request.url = self._client.format_url(_request.url, **path_format_arguments) ++ ++ _stream = False ++ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access ++ _request, stream=_stream, **kwargs ++ ) ++ ++ response = pipeline_response.http_response ++ ++ if response.status_code not in [204]: ++ map_error(status_code=response.status_code, response=response, error_map=error_map) ++ error = _failsafe_deserialize( ++ _models.ErrorResponse, ++ response, ++ ) ++ raise HttpResponseError(response=response, model=error) ++ ++ if cls: ++ return cls(pipeline_response, None, {}) # type: ignore ++ + @distributed_trace_async + async def stop_deployment( + self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any +@@ -4078,14 +4211,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @overload + async def start_log_collection( +- self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any ++ self, ++ log_collection_id: str, ++ log_collection: _types.LogCollection, ++ *, ++ content_type: str = "application/json", ++ **kwargs: Any + ) -> _models.LogCollection: + """Start the device diagnostics log collection on specified devices. + + :param log_collection_id: Log collection identifier. Required. + :type log_collection_id: str + :param log_collection: The log collection properties. Required. +- :type log_collection: JSON ++ :type log_collection: ~azure.iot.deviceupdate.types.LogCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str +@@ -4119,15 +4257,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @distributed_trace_async + async def start_log_collection( +- self, log_collection_id: str, log_collection: Union[_models.LogCollection, JSON, IO[bytes]], **kwargs: Any ++ self, ++ log_collection_id: str, ++ log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], ++ **kwargs: Any + ) -> _models.LogCollection: + """Start the device diagnostics log collection on specified devices. + + :param log_collection_id: Log collection identifier. Required. + :type log_collection_id: str +- :param log_collection: The log collection properties. Is one of the following types: +- LogCollection, JSON, IO[bytes] Required. +- :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or JSON or IO[bytes] ++ :param log_collection: The log collection properties. Is either a LogCollection type or a ++ IO[bytes] type. Required. ++ :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or ++ ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] + :return: LogCollection. The LogCollection is compatible with MutableMapping + :rtype: ~azure.iot.deviceupdate.models.LogCollection + :raises ~azure.core.exceptions.HttpResponseError: +@@ -4514,120 +4656,3 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) +- +- @distributed_trace_async +- async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> None: +- """Deletes a deployment. +- +- :param group_id: Group identifier. Required. +- :type group_id: str +- :param deployment_id: Deployment identifier. Required. +- :type deployment_id: str +- :return: None +- :rtype: None +- :raises ~azure.core.exceptions.HttpResponseError: +- """ +- error_map: MutableMapping = { +- 401: ClientAuthenticationError, +- 404: ResourceNotFoundError, +- 409: ResourceExistsError, +- 304: ResourceNotModifiedError, +- } +- error_map.update(kwargs.pop("error_map", {}) or {}) +- +- _headers = kwargs.pop("headers", {}) or {} +- _params = kwargs.pop("params", {}) or {} +- +- cls: ClsType[None] = kwargs.pop("cls", None) +- +- _request = build_device_management_delete_deployment_request( +- group_id=group_id, +- deployment_id=deployment_id, +- instance_id=self._config.instance_id, +- api_version=self._config.api_version, +- headers=_headers, +- params=_params, +- ) +- path_format_arguments = { +- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), +- } +- _request.url = self._client.format_url(_request.url, **path_format_arguments) +- +- _stream = False +- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access +- _request, stream=_stream, **kwargs +- ) +- +- response = pipeline_response.http_response +- +- if response.status_code not in [204]: +- map_error(status_code=response.status_code, response=response, error_map=error_map) +- error = _failsafe_deserialize( +- _models.ErrorResponse, +- response, +- ) +- raise HttpResponseError(response=response, model=error) +- +- if cls: +- return cls(pipeline_response, None, {}) # type: ignore +- +- @distributed_trace_async +- async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-too-long +- self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any +- ) -> None: +- """Deletes a device class subgroup deployment. +- +- :param group_id: Group identifier. Required. +- :type group_id: str +- :param device_class_id: Device class identifier. Required. +- :type device_class_id: str +- :param deployment_id: Deployment identifier. Required. +- :type deployment_id: str +- :return: None +- :rtype: None +- :raises ~azure.core.exceptions.HttpResponseError: +- """ +- error_map: MutableMapping = { +- 401: ClientAuthenticationError, +- 404: ResourceNotFoundError, +- 409: ResourceExistsError, +- 304: ResourceNotModifiedError, +- } +- error_map.update(kwargs.pop("error_map", {}) or {}) +- +- _headers = kwargs.pop("headers", {}) or {} +- _params = kwargs.pop("params", {}) or {} +- +- cls: ClsType[None] = kwargs.pop("cls", None) +- +- _request = build_device_management_delete_deployment_for_device_class_subgroup_request( +- group_id=group_id, +- device_class_id=device_class_id, +- deployment_id=deployment_id, +- instance_id=self._config.instance_id, +- api_version=self._config.api_version, +- headers=_headers, +- params=_params, +- ) +- path_format_arguments = { +- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), +- } +- _request.url = self._client.format_url(_request.url, **path_format_arguments) +- +- _stream = False +- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access +- _request, stream=_stream, **kwargs +- ) +- +- response = pipeline_response.http_response +- +- if response.status_code not in [204]: +- map_error(status_code=response.status_code, response=response, error_map=error_map) +- error = _failsafe_deserialize( +- _models.ErrorResponse, +- response, +- ) +- raise HttpResponseError(response=response, model=error) +- +- if cls: +- return cls(pipeline_response, None, {}) # type: ignore +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py +index 0cc0120119..87676c65a8 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py +@@ -8,94 +8,8 @@ + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize + """ + +-from typing import Any, List, Optional + +-from azure.core import MatchConditions +- +-from ._operations import ( +- DeviceManagementOperations as DeviceManagementOperationsGenerated, +- DeviceUpdateOperations as DeviceUpdateOperationsGenerated, +-) +- +- +-def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: +- """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw +- ``If-None-Match`` header value as-is (the generated client instead exposes the +- ``etag`` / ``match_condition`` pattern). +- +- :param kwargs: The keyword arguments forwarded to the generated operation. +- :type kwargs: any +- :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. +- :type if_none_match: str or None +- """ +- if if_none_match is not None: +- headers = kwargs.setdefault("headers", {}) +- headers.setdefault("If-None-Match", if_none_match) +- +- +-class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): +- async def get_update( +- self, +- provider: str, +- name: str, +- version: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return await super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) +- +- async def get_file( +- self, +- provider: str, +- name: str, +- version: str, +- file_id: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return await super().get_file( +- provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs +- ) +- +- async def get_operation_status( +- self, +- operation_id: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) +- +- +-class DeviceManagementOperations(DeviceManagementOperationsGenerated): +- async def get_operation_status( +- self, +- operation_id: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) +- +- +-__all__: List[str] = [ +- "DeviceUpdateOperations", +- "DeviceManagementOperations", +-] # Add all objects you want publicly available at this package level ++__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + + def patch_sdk(): +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py +index 44b7f9e907..399aa0d59b 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py +@@ -32,13 +32,12 @@ from azure.core.rest import HttpRequest, HttpResponse + from azure.core.tracing.decorator import distributed_trace + from azure.core.utils import case_insensitive_dict + +-from .. import models as _models ++from .. import models as _models, types as _types + from .._configuration import DeviceUpdateClientConfiguration + from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize + from .._utils.serialization import Deserializer, Serializer + from .._utils.utils import prep_if_match, prep_if_none_match + +-JSON = MutableMapping[str, Any] + T = TypeVar("T") + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] + +@@ -877,6 +876,28 @@ def build_device_management_create_or_update_deployment_request( # pylint: disa + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + ++def build_device_management_delete_deployment_request( # pylint: disable=name-too-long ++ group_id: str, deployment_id: str, instance_id: str, **kwargs: Any ++) -> HttpRequest: ++ _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) ++ ++ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) ++ # Construct URL ++ _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}" ++ path_format_arguments = { ++ "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), ++ "groupId": _SERIALIZER.url("group_id", group_id, "str"), ++ "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), ++ } ++ ++ _url: str = _url.format(**path_format_arguments) # type: ignore ++ ++ # Construct parameters ++ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") ++ ++ return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) ++ ++ + def build_device_management_get_deployment_status_request( # pylint: disable=name-too-long + group_id: str, deployment_id: str, instance_id: str, **kwargs: Any + ) -> HttpRequest: +@@ -1101,6 +1122,29 @@ def build_device_management_get_deployment_for_device_class_subgroup_request( # + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + ++def build_device_management_delete_deployment_for_device_class_subgroup_request( # pylint: disable=name-too-long ++ group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any ++) -> HttpRequest: ++ _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) ++ ++ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) ++ # Construct URL ++ _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}" ++ path_format_arguments = { ++ "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), ++ "groupId": _SERIALIZER.url("group_id", group_id, "str"), ++ "deviceClassId": _SERIALIZER.url("device_class_id", device_class_id, "str"), ++ "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), ++ } ++ ++ _url: str = _url.format(**path_format_arguments) # type: ignore ++ ++ # Construct parameters ++ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") ++ ++ return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) ++ ++ + def build_device_management_stop_deployment_request( # pylint: disable=name-too-long + group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any + ) -> HttpRequest: +@@ -1430,51 +1474,6 @@ def build_device_management_list_health_of_devices_request( # pylint: disable=n + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +-def build_device_management_delete_deployment_request( # pylint: disable=name-too-long +- group_id: str, deployment_id: str, instance_id: str, **kwargs: Any +-) -> HttpRequest: +- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) +- +- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) +- # Construct URL +- _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}" +- path_format_arguments = { +- "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), +- "groupId": _SERIALIZER.url("group_id", group_id, "str"), +- "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), +- } +- +- _url: str = _url.format(**path_format_arguments) # type: ignore +- +- # Construct parameters +- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") +- +- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) +- +- +-def build_device_management_delete_deployment_for_device_class_subgroup_request( # pylint: disable=name-too-long +- group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any +-) -> HttpRequest: +- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) +- +- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) +- # Construct URL +- _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}" +- path_format_arguments = { +- "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), +- "groupId": _SERIALIZER.url("group_id", group_id, "str"), +- "deviceClassId": _SERIALIZER.url("device_class_id", device_class_id, "str"), +- "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), +- } +- +- _url: str = _url.format(**path_format_arguments) # type: ignore +- +- # Construct parameters +- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") +- +- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) +- +- + class DeviceUpdateOperations: + """ + .. warning:: +@@ -1590,7 +1589,9 @@ class DeviceUpdateOperations: + return ItemPaged(get_next, extract_data) + + def _import_update_initial( +- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any ++ self, ++ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], ++ **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, +@@ -1685,7 +1686,11 @@ class DeviceUpdateOperations: + + @overload + def begin_import_update( +- self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any ++ self, ++ update_to_import: list[_types.ImportUpdateInputItem], ++ *, ++ content_type: str = "application/json", ++ **kwargs: Any + ) -> LROPoller[None]: + """Import new update version. This is a long-running-operation; use Operation-Location response + header value to check for operation status. +@@ -1694,7 +1699,7 @@ class DeviceUpdateOperations: + `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json + `_ for + details). Required. +- :type update_to_import: list[JSON] ++ :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str +@@ -1725,7 +1730,9 @@ class DeviceUpdateOperations: + + @distributed_trace + def begin_import_update( +- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any ++ self, ++ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], ++ **kwargs: Any + ) -> LROPoller[None]: + """Import new update version. This is a long-running-operation; use Operation-Location response + header value to check for operation status. +@@ -1733,9 +1740,9 @@ class DeviceUpdateOperations: + :param update_to_import: The update to be imported (see schema + `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json + `_ for +- details). Is one of the following types: [ImportUpdateInputItem], [JSON], IO[bytes] Required. ++ details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. + :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or +- list[JSON] or IO[bytes] ++ list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: +@@ -2870,7 +2877,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + def update_device_class( + self, + device_class_id: str, +- device_class_patch: JSON, ++ device_class_patch: _types.PatchBody, + *, + content_type: str = "application/merge-patch+json", + **kwargs: Any +@@ -2882,7 +2889,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :param device_class_patch: The device class json merge patch body. Currently only supports + patching + friendlyName. Required. +- :type device_class_patch: JSON ++ :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/merge-patch+json". + :paramtype content_type: str +@@ -2918,7 +2925,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @distributed_trace + def update_device_class( +- self, device_class_id: str, device_class_patch: Union[_models.PatchBody, JSON, IO[bytes]], **kwargs: Any ++ self, ++ device_class_id: str, ++ device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], ++ **kwargs: Any + ) -> _models.DeviceClass: + """Update device class details. + +@@ -2926,8 +2936,9 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :type device_class_id: str + :param device_class_patch: The device class json merge patch body. Currently only supports + patching +- friendlyName. Is one of the following types: PatchBody, JSON, IO[bytes] Required. +- :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or JSON or IO[bytes] ++ friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. ++ :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or ++ ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] + :return: DeviceClass. The DeviceClass is compatible with MutableMapping + :rtype: ~azure.iot.deviceupdate.models.DeviceClass + :raises ~azure.core.exceptions.HttpResponseError: +@@ -4144,7 +4155,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + self, + group_id: str, + deployment_id: str, +- deployment: JSON, ++ deployment: _types.Deployment, + *, + content_type: str = "application/json", + **kwargs: Any +@@ -4156,7 +4167,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str + :param deployment: The deployment properties. Required. +- :type deployment: JSON ++ :type deployment: ~azure.iot.deviceupdate.types.Deployment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str +@@ -4193,7 +4204,11 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @distributed_trace + def create_or_update_deployment( +- self, group_id: str, deployment_id: str, deployment: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any ++ self, ++ group_id: str, ++ deployment_id: str, ++ deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], ++ **kwargs: Any + ) -> _models.Deployment: + """Creates or updates a deployment. + +@@ -4201,9 +4216,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + :type group_id: str + :param deployment_id: Deployment identifier. Required. + :type deployment_id: str +- :param deployment: The deployment properties. Is one of the following types: Deployment, JSON, +- IO[bytes] Required. +- :type deployment: ~azure.iot.deviceupdate.models.Deployment or JSON or IO[bytes] ++ :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. ++ Required. ++ :type deployment: ~azure.iot.deviceupdate.models.Deployment or ++ ~azure.iot.deviceupdate.types.Deployment or IO[bytes] + :return: Deployment. The Deployment is compatible with MutableMapping + :rtype: ~azure.iot.deviceupdate.models.Deployment + :raises ~azure.core.exceptions.HttpResponseError: +@@ -4275,6 +4291,64 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + return deserialized # type: ignore + ++ @distributed_trace ++ def delete_deployment( # pylint: disable=inconsistent-return-statements ++ self, group_id: str, deployment_id: str, **kwargs: Any ++ ) -> None: ++ """Deletes a deployment. ++ ++ :param group_id: Group identifier. Required. ++ :type group_id: str ++ :param deployment_id: Deployment identifier. Required. ++ :type deployment_id: str ++ :return: None ++ :rtype: None ++ :raises ~azure.core.exceptions.HttpResponseError: ++ """ ++ error_map: MutableMapping = { ++ 401: ClientAuthenticationError, ++ 404: ResourceNotFoundError, ++ 409: ResourceExistsError, ++ 304: ResourceNotModifiedError, ++ } ++ error_map.update(kwargs.pop("error_map", {}) or {}) ++ ++ _headers = kwargs.pop("headers", {}) or {} ++ _params = kwargs.pop("params", {}) or {} ++ ++ cls: ClsType[None] = kwargs.pop("cls", None) ++ ++ _request = build_device_management_delete_deployment_request( ++ group_id=group_id, ++ deployment_id=deployment_id, ++ instance_id=self._config.instance_id, ++ api_version=self._config.api_version, ++ headers=_headers, ++ params=_params, ++ ) ++ path_format_arguments = { ++ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), ++ } ++ _request.url = self._client.format_url(_request.url, **path_format_arguments) ++ ++ _stream = False ++ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access ++ _request, stream=_stream, **kwargs ++ ) ++ ++ response = pipeline_response.http_response ++ ++ if response.status_code not in [204]: ++ map_error(status_code=response.status_code, response=response, error_map=error_map) ++ error = _failsafe_deserialize( ++ _models.ErrorResponse, ++ response, ++ ) ++ raise HttpResponseError(response=response, model=error) ++ ++ if cls: ++ return cls(pipeline_response, None, {}) # type: ignore ++ + @distributed_trace + def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: + """Gets the status of a deployment including a breakdown of how many devices in the deployment are +@@ -4903,6 +4977,67 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + return deserialized # type: ignore + ++ @distributed_trace ++ def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent-return-statements,name-too-long ++ self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any ++ ) -> None: ++ """Deletes a device class subgroup deployment. ++ ++ :param group_id: Group identifier. Required. ++ :type group_id: str ++ :param device_class_id: Device class identifier. Required. ++ :type device_class_id: str ++ :param deployment_id: Deployment identifier. Required. ++ :type deployment_id: str ++ :return: None ++ :rtype: None ++ :raises ~azure.core.exceptions.HttpResponseError: ++ """ ++ error_map: MutableMapping = { ++ 401: ClientAuthenticationError, ++ 404: ResourceNotFoundError, ++ 409: ResourceExistsError, ++ 304: ResourceNotModifiedError, ++ } ++ error_map.update(kwargs.pop("error_map", {}) or {}) ++ ++ _headers = kwargs.pop("headers", {}) or {} ++ _params = kwargs.pop("params", {}) or {} ++ ++ cls: ClsType[None] = kwargs.pop("cls", None) ++ ++ _request = build_device_management_delete_deployment_for_device_class_subgroup_request( ++ group_id=group_id, ++ device_class_id=device_class_id, ++ deployment_id=deployment_id, ++ instance_id=self._config.instance_id, ++ api_version=self._config.api_version, ++ headers=_headers, ++ params=_params, ++ ) ++ path_format_arguments = { ++ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), ++ } ++ _request.url = self._client.format_url(_request.url, **path_format_arguments) ++ ++ _stream = False ++ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access ++ _request, stream=_stream, **kwargs ++ ) ++ ++ response = pipeline_response.http_response ++ ++ if response.status_code not in [204]: ++ map_error(status_code=response.status_code, response=response, error_map=error_map) ++ error = _failsafe_deserialize( ++ _models.ErrorResponse, ++ response, ++ ) ++ raise HttpResponseError(response=response, model=error) ++ ++ if cls: ++ return cls(pipeline_response, None, {}) # type: ignore ++ + @distributed_trace + def stop_deployment( + self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any +@@ -5447,14 +5582,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @overload + def start_log_collection( +- self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any ++ self, ++ log_collection_id: str, ++ log_collection: _types.LogCollection, ++ *, ++ content_type: str = "application/json", ++ **kwargs: Any + ) -> _models.LogCollection: + """Start the device diagnostics log collection on specified devices. + + :param log_collection_id: Log collection identifier. Required. + :type log_collection_id: str + :param log_collection: The log collection properties. Required. +- :type log_collection: JSON ++ :type log_collection: ~azure.iot.deviceupdate.types.LogCollection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str +@@ -5488,15 +5628,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + + @distributed_trace + def start_log_collection( +- self, log_collection_id: str, log_collection: Union[_models.LogCollection, JSON, IO[bytes]], **kwargs: Any ++ self, ++ log_collection_id: str, ++ log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], ++ **kwargs: Any + ) -> _models.LogCollection: + """Start the device diagnostics log collection on specified devices. + + :param log_collection_id: Log collection identifier. Required. + :type log_collection_id: str +- :param log_collection: The log collection properties. Is one of the following types: +- LogCollection, JSON, IO[bytes] Required. +- :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or JSON or IO[bytes] ++ :param log_collection: The log collection properties. Is either a LogCollection type or a ++ IO[bytes] type. Required. ++ :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or ++ ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] + :return: LogCollection. The LogCollection is compatible with MutableMapping + :rtype: ~azure.iot.deviceupdate.models.LogCollection + :raises ~azure.core.exceptions.HttpResponseError: +@@ -5883,122 +6027,3 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods + return pipeline_response + + return ItemPaged(get_next, extract_data) +- +- @distributed_trace +- def delete_deployment( # pylint: disable=inconsistent-return-statements +- self, group_id: str, deployment_id: str, **kwargs: Any +- ) -> None: +- """Deletes a deployment. +- +- :param group_id: Group identifier. Required. +- :type group_id: str +- :param deployment_id: Deployment identifier. Required. +- :type deployment_id: str +- :return: None +- :rtype: None +- :raises ~azure.core.exceptions.HttpResponseError: +- """ +- error_map: MutableMapping = { +- 401: ClientAuthenticationError, +- 404: ResourceNotFoundError, +- 409: ResourceExistsError, +- 304: ResourceNotModifiedError, +- } +- error_map.update(kwargs.pop("error_map", {}) or {}) +- +- _headers = kwargs.pop("headers", {}) or {} +- _params = kwargs.pop("params", {}) or {} +- +- cls: ClsType[None] = kwargs.pop("cls", None) +- +- _request = build_device_management_delete_deployment_request( +- group_id=group_id, +- deployment_id=deployment_id, +- instance_id=self._config.instance_id, +- api_version=self._config.api_version, +- headers=_headers, +- params=_params, +- ) +- path_format_arguments = { +- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), +- } +- _request.url = self._client.format_url(_request.url, **path_format_arguments) +- +- _stream = False +- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access +- _request, stream=_stream, **kwargs +- ) +- +- response = pipeline_response.http_response +- +- if response.status_code not in [204]: +- map_error(status_code=response.status_code, response=response, error_map=error_map) +- error = _failsafe_deserialize( +- _models.ErrorResponse, +- response, +- ) +- raise HttpResponseError(response=response, model=error) +- +- if cls: +- return cls(pipeline_response, None, {}) # type: ignore +- +- @distributed_trace +- def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent-return-statements,name-too-long +- self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any +- ) -> None: +- """Deletes a device class subgroup deployment. +- +- :param group_id: Group identifier. Required. +- :type group_id: str +- :param device_class_id: Device class identifier. Required. +- :type device_class_id: str +- :param deployment_id: Deployment identifier. Required. +- :type deployment_id: str +- :return: None +- :rtype: None +- :raises ~azure.core.exceptions.HttpResponseError: +- """ +- error_map: MutableMapping = { +- 401: ClientAuthenticationError, +- 404: ResourceNotFoundError, +- 409: ResourceExistsError, +- 304: ResourceNotModifiedError, +- } +- error_map.update(kwargs.pop("error_map", {}) or {}) +- +- _headers = kwargs.pop("headers", {}) or {} +- _params = kwargs.pop("params", {}) or {} +- +- cls: ClsType[None] = kwargs.pop("cls", None) +- +- _request = build_device_management_delete_deployment_for_device_class_subgroup_request( +- group_id=group_id, +- device_class_id=device_class_id, +- deployment_id=deployment_id, +- instance_id=self._config.instance_id, +- api_version=self._config.api_version, +- headers=_headers, +- params=_params, +- ) +- path_format_arguments = { +- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), +- } +- _request.url = self._client.format_url(_request.url, **path_format_arguments) +- +- _stream = False +- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access +- _request, stream=_stream, **kwargs +- ) +- +- response = pipeline_response.http_response +- +- if response.status_code not in [204]: +- map_error(status_code=response.status_code, response=response, error_map=error_map) +- error = _failsafe_deserialize( +- _models.ErrorResponse, +- response, +- ) +- raise HttpResponseError(response=response, model=error) +- +- if cls: +- return cls(pipeline_response, None, {}) # type: ignore +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py +index dd6b7c08ad..87676c65a8 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py +@@ -8,92 +8,8 @@ + Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize + """ + +-from typing import Any, List, Optional + +-from azure.core import MatchConditions +- +-from ._operations import ( +- DeviceManagementOperations as DeviceManagementOperationsGenerated, +- DeviceUpdateOperations as DeviceUpdateOperationsGenerated, +-) +- +- +-def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: +- """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw +- ``If-None-Match`` header value as-is (the generated client instead exposes the +- ``etag`` / ``match_condition`` pattern). +- +- :param kwargs: The keyword arguments forwarded to the generated operation. +- :type kwargs: any +- :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. +- :type if_none_match: str or None +- """ +- if if_none_match is not None: +- headers = kwargs.setdefault("headers", {}) +- headers.setdefault("If-None-Match", if_none_match) +- +- +-class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): +- def get_update( +- self, +- provider: str, +- name: str, +- version: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) +- +- def get_file( +- self, +- provider: str, +- name: str, +- version: str, +- file_id: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return super().get_file(provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs) +- +- def get_operation_status( +- self, +- operation_id: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) +- +- +-class DeviceManagementOperations(DeviceManagementOperationsGenerated): +- def get_operation_status( +- self, +- operation_id: str, +- *, +- etag: Optional[str] = None, +- match_condition: Optional[MatchConditions] = None, +- if_none_match: Optional[str] = None, +- **kwargs: Any, +- ): +- _apply_if_none_match(kwargs, if_none_match) +- return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) +- +- +-__all__: List[str] = [ +- "DeviceUpdateOperations", +- "DeviceManagementOperations", +-] # Add all objects you want publicly available at this package level ++__all__: list[str] = [] # Add all objects you want publicly available to users at this package level + + + def patch_sdk(): +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py +new file mode 100644 +index 0000000000..c198e1ee1c +--- /dev/null ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py +@@ -0,0 +1,269 @@ ++# coding=utf-8 ++# -------------------------------------------------------------------------- ++# Copyright (c) Microsoft Corporation. All rights reserved. ++# Licensed under the MIT License. See License.txt in the project root for license information. ++# Code generated by Microsoft (R) Python Code Generator. ++# Changes may cause incorrect behavior and will be lost if the code is regenerated. ++# -------------------------------------------------------------------------- ++ ++from typing import TYPE_CHECKING, Union ++from typing_extensions import Required, TypedDict ++ ++if TYPE_CHECKING: ++ from .models import DownloadSecurity, OperationStatus ++ ++ ++class CloudInitiatedRollbackPolicy(TypedDict, total=False): ++ """Rollback policy for deployment. ++ ++ :ivar update_property: Update to rollback to. Required. ++ :vartype update_property: "UpdateInfo" ++ :ivar failure: Failure conditions to initiate rollback policy. Required. ++ :vartype failure: "CloudInitiatedRollbackPolicyFailure" ++ """ ++ ++ update: Required["UpdateInfo"] ++ """Update to rollback to. Required.""" ++ failure: Required["CloudInitiatedRollbackPolicyFailure"] ++ """Failure conditions to initiate rollback policy. Required.""" ++ ++ ++class CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): ++ """Failure conditions to initiate rollback policy. ++ ++ :ivar devices_failed_percentage: Percentage of devices that failed. Required. ++ :vartype devices_failed_percentage: int ++ :ivar devices_failed_count: Number of devices that failed. Required. ++ :vartype devices_failed_count: int ++ """ ++ ++ devicesFailedPercentage: Required[int] ++ """Percentage of devices that failed. Required.""" ++ devicesFailedCount: Required[int] ++ """Number of devices that failed. Required.""" ++ ++ ++class Deployment(TypedDict, total=False): ++ """Deployment metadata. ++ ++ :ivar deployment_id: The caller-provided deployment identifier. This cannot be longer than 73 ++ characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', ++ '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub ++ resource generates a GUID for deploymentId when you create a deployment. Required. ++ :vartype deployment_id: str ++ :ivar start_date_time: The deployment start datetime. Required. ++ :vartype start_date_time: str ++ :ivar update_property: Update information for the update in the deployment. Required. ++ :vartype update_property: "UpdateInfo" ++ :ivar group_id: The group identity for the devices the deployment is intended to update. ++ Required. ++ :vartype group_id: str ++ :ivar device_class_subgroups: The device class subgroups the deployment is compatible with and ++ subgroup deployments have been created for. This is not provided by the caller during ++ CreateOrUpdateDeployment but is automatically determined by Device Update. ++ :vartype device_class_subgroups: list[str] ++ :ivar is_canceled: Boolean flag indicating whether the deployment was canceled. ++ :vartype is_canceled: bool ++ :ivar is_retried: Boolean flag indicating whether the deployment has been retried. ++ :vartype is_retried: bool ++ :ivar rollback_policy: The rollback policy for the deployment. ++ :vartype rollback_policy: "CloudInitiatedRollbackPolicy" ++ :ivar is_cloud_initiated_rollback: Boolean flag indicating whether the deployment is a rollback ++ deployment. ++ :vartype is_cloud_initiated_rollback: bool ++ :ivar download_security: The protocol the device should use when downloading the update ++ payload. Defaults to "https". Known values are: "https" and "http". ++ :vartype download_security: Union[str, "DownloadSecurity"] ++ """ ++ ++ deploymentId: Required[str] ++ """The caller-provided deployment identifier. This cannot be longer than 73 characters, must be ++ all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, ++ backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a ++ GUID for deploymentId when you create a deployment. Required.""" ++ startDateTime: Required[str] ++ """The deployment start datetime. Required.""" ++ update: Required["UpdateInfo"] ++ """Update information for the update in the deployment. Required.""" ++ groupId: Required[str] ++ """The group identity for the devices the deployment is intended to update. Required.""" ++ deviceClassSubgroups: list[str] ++ """The device class subgroups the deployment is compatible with and subgroup deployments have been ++ created for. This is not provided by the caller during CreateOrUpdateDeployment but is ++ automatically determined by Device Update.""" ++ isCanceled: bool ++ """Boolean flag indicating whether the deployment was canceled.""" ++ isRetried: bool ++ """Boolean flag indicating whether the deployment has been retried.""" ++ rollbackPolicy: "CloudInitiatedRollbackPolicy" ++ """The rollback policy for the deployment.""" ++ isCloudInitiatedRollback: bool ++ """Boolean flag indicating whether the deployment is a rollback deployment.""" ++ downloadSecurity: Union[str, "DownloadSecurity"] ++ """The protocol the device should use when downloading the update payload. Defaults to \"https\". ++ Known values are: \"https\" and \"http\".""" ++ ++ ++class DeviceUpdateAgentId(TypedDict, total=False): ++ """Device Update agent id. ++ ++ :ivar device_id: Device Id. Required. ++ :vartype device_id: str ++ :ivar module_id: Module Id. ++ :vartype module_id: str ++ """ ++ ++ deviceId: Required[str] ++ """Device Id. Required.""" ++ moduleId: str ++ """Module Id.""" ++ ++ ++class FileImportMetadata(TypedDict, total=False): ++ """Metadata describing an update file. ++ ++ :ivar filename: Update file name as specified inside import manifest. Required. ++ :vartype filename: str ++ :ivar url: Azure Blob location from which the update file can be downloaded by Device Update ++ for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at ++ least 4 hours. Required. ++ :vartype url: str ++ """ ++ ++ filename: Required[str] ++ """Update file name as specified inside import manifest. Required.""" ++ url: Required[str] ++ """Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. ++ This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 ++ hours. Required.""" ++ ++ ++class ImportManifestMetadata(TypedDict, total=False): ++ """Metadata describing the import manifest, a document which describes the files and other ++ metadata about an update version. ++ ++ :ivar url: Azure Blob location from which the import manifest can be downloaded by Device ++ Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set ++ to at least 4 hours. Required. ++ :vartype url: str ++ :ivar size_in_bytes: File size in number of bytes. Required. ++ :vartype size_in_bytes: int ++ :ivar hashes: A JSON object containing the hash(es) of the file. At least SHA256 hash is ++ required. This object can be thought of as a set of key-value pairs where the key is the hash ++ algorithm, and the value is the hash of the file calculated using that algorithm. Required. ++ :vartype hashes: dict[str, str] ++ """ ++ ++ url: Required[str] ++ """Azure Blob location from which the import manifest can be downloaded by Device Update for IoT ++ Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 ++ hours. Required.""" ++ sizeInBytes: Required[int] ++ """File size in number of bytes. Required.""" ++ hashes: Required[dict[str, str]] ++ """A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This ++ object can be thought of as a set of key-value pairs where the key is the hash algorithm, and ++ the value is the hash of the file calculated using that algorithm. Required.""" ++ ++ ++class ImportUpdateInputItem(TypedDict, total=False): ++ """Import update input item metadata. ++ ++ :ivar import_manifest: Import manifest metadata like source URL, file size/hashes, etc. ++ Required. ++ :vartype import_manifest: "ImportManifestMetadata" ++ :ivar friendly_name: Friendly update name. ++ :vartype friendly_name: str ++ :ivar files: One or more update file properties like filename and source URL. ++ :vartype files: list["FileImportMetadata"] ++ """ ++ ++ importManifest: Required["ImportManifestMetadata"] ++ """Import manifest metadata like source URL, file size/hashes, etc. Required.""" ++ friendlyName: str ++ """Friendly update name.""" ++ files: list["FileImportMetadata"] ++ """One or more update file properties like filename and source URL.""" ++ ++ ++class LogCollection(TypedDict, total=False): ++ """Diagnostics request body. ++ ++ :ivar log_collection_id: The log collection id. ++ :vartype log_collection_id: str ++ :ivar device_list: Array of Device Update agent ids. Required. ++ :vartype device_list: list["DeviceUpdateAgentId"] ++ :ivar description: Description of the diagnostics operation. ++ :vartype description: str ++ :ivar created_date_time: The timestamp when the operation was created. ++ :vartype created_date_time: str ++ :ivar last_action_date_time: A timestamp for when the current state was entered. ++ :vartype last_action_date_time: str ++ :ivar status: Operation status. Known values are: "NotStarted", "Running", "Succeeded", and ++ "Failed". ++ :vartype status: Union[str, "OperationStatus"] ++ """ ++ ++ operationId: str ++ """The log collection id.""" ++ deviceList: Required[list["DeviceUpdateAgentId"]] ++ """Array of Device Update agent ids. Required.""" ++ description: str ++ """Description of the diagnostics operation.""" ++ createdDateTime: str ++ """The timestamp when the operation was created.""" ++ lastActionDateTime: str ++ """A timestamp for when the current state was entered.""" ++ status: Union[str, "OperationStatus"] ++ """Operation status. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and \"Failed\".""" ++ ++ ++class PatchBody(TypedDict, total=False): ++ """Device Class JSON Merge Patch request body. ++ ++ :ivar friendly_name: The device class friendly name. Friendly name can be 1-100 characters, ++ alphanumeric, dot, and dash. Required. ++ :vartype friendly_name: str ++ """ ++ ++ friendlyName: Required[str] ++ """The device class friendly name. Friendly name can be 1-100 characters, alphanumeric, dot, and ++ dash. Required.""" ++ ++ ++class UpdateId(TypedDict, total=False): ++ """Update identifier. ++ ++ :ivar provider: Update provider. Required. ++ :vartype provider: str ++ :ivar name: Update name. Required. ++ :vartype name: str ++ :ivar version: Update version. Required. ++ :vartype version: str ++ """ ++ ++ provider: Required[str] ++ """Update provider. Required.""" ++ name: Required[str] ++ """Update name. Required.""" ++ version: Required[str] ++ """Update version. Required.""" ++ ++ ++class UpdateInfo(TypedDict, total=False): ++ """Update information. ++ ++ :ivar update_id: Update identifier. Required. ++ :vartype update_id: "UpdateId" ++ :ivar description: Update description. ++ :vartype description: str ++ :ivar friendly_name: Friendly update name. ++ :vartype friendly_name: str ++ """ ++ ++ updateId: Required["UpdateId"] ++ """Update identifier. Required.""" ++ description: str ++ """Update description.""" ++ friendlyName: str ++ """Friendly update name.""" +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml +index a77c2ee731..211c5f15dd 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml +@@ -1,19 +1,23 @@ ++# -------------------------------------------------------------------------- ++# Copyright (c) Microsoft Corporation. All rights reserved. ++# Licensed under the MIT License. See License.txt in the project root for license information. ++# Code generated by Microsoft (R) Python Code Generator. ++# Changes may cause incorrect behavior and will be lost if the code is regenerated. ++# -------------------------------------------------------------------------- ++ + [build-system] +-requires = [ +- "setuptools>=77.0.3", +- "wheel", +-] ++requires = ["setuptools>=77.0.3", "wheel"] + build-backend = "setuptools.build_meta" + + [project] + name = "azure-iot-deviceupdate" + authors = [ +- { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, ++ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, + ] + description = "Microsoft Corporation Azure Iot Deviceupdate Client Library for Python" + license = "MIT" + classifiers = [ +- "Development Status :: 5 - Production/Stable", ++ "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", +@@ -24,32 +28,23 @@ classifiers = [ + "Programming Language :: Python :: 3.14", + ] + requires-python = ">=3.10" +-keywords = [ +- "azure", +- "azure sdk", +-] ++keywords = ["azure", "azure sdk"] ++ + dependencies = [ + "isodate>=0.6.1", + "azure-core>=1.37.0", + "typing-extensions>=4.6.0", + ] + dynamic = [ +- "version", +- "readme", ++"version", "readme" + ] + + [project.urls] + repository = "https://github.com/Azure/azure-sdk-for-python" + +-[tool.setuptools.dynamic.version] +-attr = "azure.iot.deviceupdate._version.VERSION" +- +-[tool.setuptools.dynamic.readme] +-file = [ +- "README.md", +- "CHANGELOG.md", +-] +-content-type = "text/markdown" ++[tool.setuptools.dynamic] ++version = {attr = "azure.iot.deviceupdate._version.VERSION"} ++readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} + + [tool.setuptools.packages.find] + exclude = [ +@@ -63,9 +58,7 @@ exclude = [ + ] + + [tool.setuptools.package-data] +-pytyped = [ +- "py.typed", +-] ++pytyped = ["py.typed"] + + [tool.azure-sdk-build] + pyright = false +diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml +index dfe6b1560e..f8595069c1 100644 +--- a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml ++++ b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml +@@ -1,4 +1,4 @@ + directory: specification/deviceupdate/data-plane/duiothub +-commit: 292231b1131ff9fd070377372a0647c6ac7a6ce2 ++commit: 67ffbb6bee462e36bcdd3b93cffca6942c3a35f7 + repo: Azure/azure-rest-api-specs + additionalDirectories: diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md index 9953f5d4e01e..2498daf3ab91 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md @@ -2,7 +2,16 @@ ## 1.1.0 (2026-07-30) -skip changelog generation for data-plane package and please add changelog manually. +### Features Added + +- Regenerated the client library from the TypeSpec specification for the Device Update for IoT Hub `2026-06-01` GA API version. + +### Breaking Changes + +- Changed the positional parameter order of `DeviceUpdateClient` from `endpoint, instance_id, credential` to `endpoint, credential, instance_id` for both synchronous and asynchronous clients. +- Replaced the `if_none_match` keyword parameter with `etag` and `match_condition` in `get_update`, `get_file`, and `get_operation_status` for both synchronous and asynchronous clients. +- Raised the minimum supported Python version from 3.6 to 3.10. +- Raised the minimum supported `azure-core` version from 1.24.0 to 1.37.0. ## 1.0.0 (2022-09-09) From 7a5f8356c35930cde5ddda6d3c8fc94244dd630c Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Fri, 31 Jul 2026 15:30:09 -0400 Subject: [PATCH 06/11] Remove temporary diff file --- commit.diff | 2752 --------------------------------------------------- 1 file changed, 2752 deletions(-) delete mode 100644 commit.diff diff --git a/commit.diff b/commit.diff deleted file mode 100644 index 899918b54541..000000000000 --- a/commit.diff +++ /dev/null @@ -1,2752 +0,0 @@ -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md -index 2c82bfd62b..992f0a2c7e 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md -@@ -1,19 +1,8 @@ - # Release History - --## 1.1.0 (2026-06-15) -+## 1.1.0 (2026-07-29) - --### Features Added -- --- Regenerated client from TypeSpec specification. The library now uses the unified -- `azure.core` HTTP pipeline and shares model infrastructure with other modern -- Azure Python SDKs. -- --### Other Changes -- --- Migrated source of truth from Swagger to TypeSpec -- (`specification/deviceupdate/data-plane/duiothub`). --- Updated minimum required `azure-core` to `1.37.0`. --- Dropped support for Python 3.8 and 3.9; minimum supported Python is 3.10. -+skip changelog generation for data-plane package and please add changelog manually. - - ## 1.0.0 (2022-09-09) - -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json -index 614a01ddd5..f1a5c7e5f9 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json -@@ -3,9 +3,9 @@ - "apiVersions": { - "DeviceUpdateClient": "2026-06-01" - }, -- "commit": "292231b1131ff9fd070377372a0647c6ac7a6ce2", -+ "commit": "67ffbb6bee462e36bcdd3b93cffca6942c3a35f7", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/deviceupdate/data-plane/duiothub", -- "emitterVersion": "0.63.1", -- "httpClientPythonVersion": "^0.31.1" -+ "emitterVersion": "0.63.3", -+ "httpClientPythonVersion": "^0.34.2" - } -\ No newline at end of file -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.md b/sdk/deviceupdate/azure-iot-deviceupdate/api.md -index 061ec5136e..3df29b42d6 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/api.md -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.md -@@ -1,15 +1,18 @@ - ```py - namespace azure.iot.deviceupdate - -- class azure.iot.deviceupdate.DeviceUpdateClient(DeviceUpdateClientGenerated): implements ContextManager -+ class azure.iot.deviceupdate.DeviceUpdateClient: implements ContextManager -+ device_management: DeviceManagementOperations -+ device_update: DeviceUpdateOperations - - def __init__( - self, - endpoint: str, -- instance_id: str, - credential: TokenCredential, -+ instance_id: str, - *, -- api_version: Optional[str] = ..., -+ api_version: str = ..., -+ polling_interval: Optional[int] = ..., - **kwargs: Any - ) -> None: ... - -@@ -26,15 +29,18 @@ namespace azure.iot.deviceupdate - - namespace azure.iot.deviceupdate.aio - -- class azure.iot.deviceupdate.aio.DeviceUpdateClient(DeviceUpdateClientGenerated): implements AsyncContextManager -+ class azure.iot.deviceupdate.aio.DeviceUpdateClient: implements AsyncContextManager -+ device_management: DeviceManagementOperations -+ device_update: DeviceUpdateOperations - - def __init__( - self, - endpoint: str, -- instance_id: str, - credential: AsyncTokenCredential, -+ instance_id: str, - *, -- api_version: Optional[str] = ..., -+ api_version: str = ..., -+ polling_interval: Optional[int] = ..., - **kwargs: Any - ) -> None: ... - -@@ -51,7 +57,7 @@ namespace azure.iot.deviceupdate.aio - - namespace azure.iot.deviceupdate.aio.operations - -- class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): -+ class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations: - - def __init__( - self, -@@ -82,7 +88,7 @@ namespace azure.iot.deviceupdate.aio.operations - self, - group_id: str, - deployment_id: str, -- deployment: JSON, -+ deployment: Deployment, - *, - content_type: str = "application/json", - **kwargs: Any -@@ -239,15 +245,15 @@ namespace azure.iot.deviceupdate.aio.operations - **kwargs: Any - ) -> LogCollectionOperationDetailedStatus: ... - -+ @distributed_trace_async - async def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> DeviceOperation: ... - - @distributed_trace_async - async def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... -@@ -379,7 +385,7 @@ namespace azure.iot.deviceupdate.aio.operations - async def start_log_collection( - self, - log_collection_id: str, -- log_collection: JSON, -+ log_collection: LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any -@@ -418,7 +424,7 @@ namespace azure.iot.deviceupdate.aio.operations - async def update_device_class( - self, - device_class_id: str, -- device_class_patch: JSON, -+ device_class_patch: PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any -@@ -435,7 +441,7 @@ namespace azure.iot.deviceupdate.aio.operations - ) -> DeviceClass: ... - - -- class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): -+ class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations: - - def __init__( - self, -@@ -464,7 +470,7 @@ namespace azure.iot.deviceupdate.aio.operations - @overload - async def begin_import_update( - self, -- update_to_import: list[JSON], -+ update_to_import: list[ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any -@@ -479,6 +485,7 @@ namespace azure.iot.deviceupdate.aio.operations - **kwargs: Any - ) -> AsyncLROPoller[None]: ... - -+ @distributed_trace_async - async def get_file( - self, - provider: str, -@@ -487,21 +494,21 @@ namespace azure.iot.deviceupdate.aio.operations - file_id: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> UpdateFile: ... - -+ @distributed_trace_async - async def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> UpdateOperation: ... - -+ @distributed_trace_async - async def get_update( - self, - provider: str, -@@ -509,10 +516,9 @@ namespace azure.iot.deviceupdate.aio.operations - version: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> Update: ... - - @distributed_trace - def list_files( -@@ -1470,7 +1476,7 @@ namespace azure.iot.deviceupdate.models - - namespace azure.iot.deviceupdate.operations - -- class azure.iot.deviceupdate.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): -+ class azure.iot.deviceupdate.operations.DeviceManagementOperations: - - def __init__( - self, -@@ -1501,7 +1507,7 @@ namespace azure.iot.deviceupdate.operations - self, - group_id: str, - deployment_id: str, -- deployment: JSON, -+ deployment: Deployment, - *, - content_type: str = "application/json", - **kwargs: Any -@@ -1658,15 +1664,15 @@ namespace azure.iot.deviceupdate.operations - **kwargs: Any - ) -> LogCollectionOperationDetailedStatus: ... - -+ @distributed_trace - def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> DeviceOperation: ... - - @distributed_trace - def get_update_compliance(self, **kwargs: Any) -> UpdateCompliance: ... -@@ -1798,7 +1804,7 @@ namespace azure.iot.deviceupdate.operations - def start_log_collection( - self, - log_collection_id: str, -- log_collection: JSON, -+ log_collection: LogCollection, - *, - content_type: str = "application/json", - **kwargs: Any -@@ -1837,7 +1843,7 @@ namespace azure.iot.deviceupdate.operations - def update_device_class( - self, - device_class_id: str, -- device_class_patch: JSON, -+ device_class_patch: PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any -@@ -1854,7 +1860,7 @@ namespace azure.iot.deviceupdate.operations - ) -> DeviceClass: ... - - -- class azure.iot.deviceupdate.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): -+ class azure.iot.deviceupdate.operations.DeviceUpdateOperations: - - def __init__( - self, -@@ -1883,7 +1889,7 @@ namespace azure.iot.deviceupdate.operations - @overload - def begin_import_update( - self, -- update_to_import: list[JSON], -+ update_to_import: list[ImportUpdateInputItem], - *, - content_type: str = "application/json", - **kwargs: Any -@@ -1898,6 +1904,7 @@ namespace azure.iot.deviceupdate.operations - **kwargs: Any - ) -> LROPoller[None]: ... - -+ @distributed_trace - def get_file( - self, - provider: str, -@@ -1906,21 +1913,21 @@ namespace azure.iot.deviceupdate.operations - file_id: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> UpdateFile: ... - -+ @distributed_trace - def get_operation_status( - self, - operation_id: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> UpdateOperation: ... - -+ @distributed_trace - def get_update( - self, - provider: str, -@@ -1928,10 +1935,9 @@ namespace azure.iot.deviceupdate.operations - version: str, - *, - etag: Optional[str] = ..., -- if_none_match: Optional[str] = ..., - match_condition: Optional[MatchConditions] = ..., - **kwargs: Any -- ): ... -+ ) -> Update: ... - - @distributed_trace - def list_files( -@@ -1981,4 +1987,112 @@ namespace azure.iot.deviceupdate.operations - ) -> ItemPaged[str]: ... - - -+namespace azure.iot.deviceupdate.types -+ -+ class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicy(TypedDict, total=False): -+ key "failure": Required[CloudInitiatedRollbackPolicyFailure] -+ key "update": Required[UpdateInfo] -+ failure: CloudInitiatedRollbackPolicyFailure -+ update_property: UpdateInfo -+ -+ -+ class azure.iot.deviceupdate.types.CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): -+ key "devicesFailedCount": Required[int] -+ key "devicesFailedPercentage": Required[int] -+ devices_failed_count: int -+ devices_failed_percentage: int -+ -+ -+ class azure.iot.deviceupdate.types.Deployment(TypedDict, total=False): -+ key "deploymentId": Required[str] -+ key "downloadSecurity": Union[str, DownloadSecurity] -+ key "groupId": Required[str] -+ key "isCanceled": bool -+ key "isCloudInitiatedRollback": bool -+ key "isRetried": bool -+ key "rollbackPolicy": ForwardRef('CloudInitiatedRollbackPolicy', module='types') -+ key "startDateTime": Required[str] -+ key "update": Required[UpdateInfo] -+ deployment_id: str -+ deviceClassSubgroups: list[str] -+ device_class_subgroups: list[str] -+ download_security: Union[str, DownloadSecurity] -+ group_id: str -+ is_canceled: bool -+ is_cloud_initiated_rollback: bool -+ is_retried: bool -+ rollback_policy: CloudInitiatedRollbackPolicy -+ start_date_time: str -+ update_property: UpdateInfo -+ -+ -+ class azure.iot.deviceupdate.types.DeviceUpdateAgentId(TypedDict, total=False): -+ key "deviceId": Required[str] -+ key "moduleId": str -+ device_id: str -+ module_id: str -+ -+ -+ class azure.iot.deviceupdate.types.FileImportMetadata(TypedDict, total=False): -+ key "filename": Required[str] -+ key "url": Required[str] -+ filename: str -+ url: str -+ -+ -+ class azure.iot.deviceupdate.types.ImportManifestMetadata(TypedDict, total=False): -+ key "hashes": Required[dict[str, str]] -+ key "sizeInBytes": Required[int] -+ key "url": Required[str] -+ hashes: dict[str, str] -+ size_in_bytes: int -+ url: str -+ -+ -+ class azure.iot.deviceupdate.types.ImportUpdateInputItem(TypedDict, total=False): -+ key "friendlyName": str -+ key "importManifest": Required[ImportManifestMetadata] -+ files: list[FileImportMetadata] -+ friendly_name: str -+ import_manifest: ImportManifestMetadata -+ -+ -+ class azure.iot.deviceupdate.types.LogCollection(TypedDict, total=False): -+ key "createdDateTime": str -+ key "description": str -+ key "deviceList": Required[list[DeviceUpdateAgentId]] -+ key "lastActionDateTime": str -+ key "operationId": str -+ key "status": Union[str, OperationStatus] -+ created_date_time: str -+ description: str -+ device_list: list[DeviceUpdateAgentId] -+ last_action_date_time: str -+ log_collection_id: str -+ status: Union[str, OperationStatus] -+ -+ -+ class azure.iot.deviceupdate.types.PatchBody(TypedDict, total=False): -+ key "friendlyName": Required[str] -+ friendly_name: str -+ -+ -+ class azure.iot.deviceupdate.types.UpdateId(TypedDict, total=False): -+ key "name": Required[str] -+ key "provider": Required[str] -+ key "version": Required[str] -+ name: str -+ provider: str -+ version: str -+ -+ -+ class azure.iot.deviceupdate.types.UpdateInfo(TypedDict, total=False): -+ key "description": str -+ key "friendlyName": str -+ key "updateId": Required[UpdateId] -+ description: str -+ friendly_name: str -+ update_id: UpdateId -+ -+ - ``` -\ No newline at end of file -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml -index 408933ae1c..a4a121bbf9 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml -@@ -1,3 +1,3 @@ --apiMdSha256: 555c6332bae64960b1565938ed0453aac0b22874c60b4c3c7ed0d8de8156c371 --parserVersion: 0.3.28 --pythonVersion: 3.13.12 -+apiMdSha256: e6da310dba4ea5263163ad432f276371b3025fcca87680847e130581a6157980 -+parserVersion: 0.3.30 -+pythonVersion: 3.13.14 -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json -index 5d72b7c262..d5edd1a085 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json -@@ -51,106 +51,106 @@ - "azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState": "DeviceUpdateClient.DeviceClassSubgroupDeploymentState", - "azure.iot.deviceupdate.models.DeviceHealthState": "DeviceUpdateClient.DeviceHealthState", - "azure.iot.deviceupdate.models.HealthCheckResult": "DeviceUpdateClient.HealthCheckResult", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_import_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_delete_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_delete_update": "DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_providers": "DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_providers": "DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_names": "DeviceUpdateClient.DeviceUpdateOperationGroup.listNames", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_names": "DeviceUpdateClient.DeviceUpdateOperationGroup.listNames", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_versions": "DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_versions": "DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_files": "DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "DeviceUpdateClient.DeviceUpdateOperationGroup.getFile", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "DeviceUpdateClient.DeviceUpdateOperationGroup.getFile", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses", -- "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus", -- "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.update_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.update_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listDevices", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listDevices", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.begin_import_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.importDevices", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.begin_import_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.importDevices", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device": "DeviceUpdateClient.DeviceManagementOperationGroup.getDevice", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device": "DeviceUpdateClient.DeviceManagementOperationGroup.getDevice", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_module": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_module": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_groups": "DeviceUpdateClient.DeviceManagementOperationGroup.listGroups", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_groups": "DeviceUpdateClient.DeviceManagementOperationGroup.listGroups", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getGroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getGroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.create_or_update_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.create_or_update_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment", -- "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup", -- "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup" -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_updates": "Customization.ClientDeviceUpdateService.DeviceUpdate.listUpdates", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_import_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.importUpdate", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.getUpdate", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.getUpdate", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.begin_delete_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.deleteUpdate", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.begin_delete_update": "Customization.ClientDeviceUpdateService.DeviceUpdate.deleteUpdate", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_providers": "Customization.ClientDeviceUpdateService.DeviceUpdate.listProviders", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_providers": "Customization.ClientDeviceUpdateService.DeviceUpdate.listProviders", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_names": "Customization.ClientDeviceUpdateService.DeviceUpdate.listNames", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_names": "Customization.ClientDeviceUpdateService.DeviceUpdate.listNames", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_versions": "Customization.ClientDeviceUpdateService.DeviceUpdate.listVersions", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_versions": "Customization.ClientDeviceUpdateService.DeviceUpdate.listVersions", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_files": "Customization.ClientDeviceUpdateService.DeviceUpdate.listFiles", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_file": "Customization.ClientDeviceUpdateService.DeviceUpdate.getFile", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceUpdate.listOperationStatuses", -+ "azure.iot.deviceupdate.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", -+ "azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceUpdate.getOperationStatus", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_classes": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClasses", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClass", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.update_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.updateDeviceClass", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.update_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.updateDeviceClass", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClass", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClass", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.listInstallableUpdatesForDeviceClass", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_installable_updates_for_device_class": "Customization.ClientDeviceUpdateService.DeviceManagement.listInstallableUpdatesForDeviceClass", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listDevices", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listDevices", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.begin_import_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.importDevices", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.begin_import_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.importDevices", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device": "Customization.ClientDeviceUpdateService.DeviceManagement.getDevice", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device": "Customization.ClientDeviceUpdateService.DeviceManagement.getDevice", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_module": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceModule", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_module": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceModule", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateCompliance", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateCompliance", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_groups": "Customization.ClientDeviceUpdateService.DeviceManagement.listGroups", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_groups": "Customization.ClientDeviceUpdateService.DeviceManagement.listGroups", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getGroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_group": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteGroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_update_compliance_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.getUpdateComplianceForGroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_best_updates_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listBestUpdatesForGroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForGroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeployment", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeployment", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.create_or_update_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.createOrUpdateDeployment", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.create_or_update_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.createOrUpdateDeployment", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeployment", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeployment", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentStatus", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_class_subgroups_for_group": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceClassSubgroupsForGroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeviceClassSubgroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_update_compliance": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupUpdateCompliance", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_best_updates_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getBestUpdatesForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_deployments_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeploymentsForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeploymentForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.delete_deployment_for_device_class_subgroup": "Customization.ClientDeviceUpdateService.DeviceManagement.deleteDeploymentForDeviceClassSubgroup", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.stop_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.stopDeployment", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.retry_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.retryDeployment", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_device_class_subgroup_deployment_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getDeviceClassSubgroupDeploymentStatus", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_device_states_for_device_class_subgroup_deployment": "Customization.ClientDeviceUpdateService.DeviceManagement.listDeviceStatesForDeviceClassSubgroupDeployment", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_operation_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getOperationStatus", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_operation_statuses": "Customization.ClientDeviceUpdateService.DeviceManagement.listOperationStatuses", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.start_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.startLogCollection", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollection", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_log_collections": "Customization.ClientDeviceUpdateService.DeviceManagement.listLogCollections", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.get_log_collection_detailed_status": "Customization.ClientDeviceUpdateService.DeviceManagement.getLogCollectionDetailedStatus", -+ "azure.iot.deviceupdate.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices", -+ "azure.iot.deviceupdate.aio.operations.DeviceManagementOperations.list_health_of_devices": "Customization.ClientDeviceUpdateService.DeviceManagement.listHealthOfDevices" - }, -- "CrossLanguageVersion": "2152dadbc310" -+ "CrossLanguageVersion": "c1a73ac75a65" - } -\ No newline at end of file -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py -index c696364981..0b2f1892b1 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py -@@ -28,12 +28,7 @@ if TYPE_CHECKING: - - - class DeviceUpdateClient: -- """Device Update for IoT Hub is an Azure service that enables customers to publish updates for -- their IoT devices to the cloud, and then deploy that update to their devices (approve updates -- to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and -- reliability of the Windows Update platform, optimized for IoT devices. It works globally and -- knows when and how to update devices, enabling customers to focus on their business goals and -- let Device Update for IoT Hub handle the updates. -+ """DeviceUpdateClient. - - :ivar device_update: DeviceUpdateOperations operations - :vartype device_update: azure.iot.deviceupdate.operations.DeviceUpdateOperations -@@ -107,7 +102,7 @@ class DeviceUpdateClient: - - request_copy = deepcopy(request) - path_format_arguments = { -- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), -+ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py -index f3dc84c614..2431c67afc 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py -@@ -29,9 +29,9 @@ class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attr - :type credential: ~azure.core.credentials.TokenCredential - :param instance_id: The Device Update for IoT Hub account instance identifier. Required. - :type instance_id: str -- :keyword api_version: The API version to use for this operation. Known values are "2026-06-01". -- Default value is "2026-06-01". Note that overriding this default value may result in unsupported -- behavior. -+ :keyword api_version: The API version to use for this operation. Known values are "2026-06-01" -+ and None. Default value is None. If not set, the operation's default API version will be used. -+ Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py -index 2485462aff..87676c65a8 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py -@@ -8,48 +8,8 @@ - Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize - """ - --from typing import Any, List, Optional, TYPE_CHECKING - --from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated -- --if TYPE_CHECKING: -- from azure.core.credentials import TokenCredential -- -- --class DeviceUpdateClient(DeviceUpdateClientGenerated): -- """Device Update for IoT Hub client. -- -- This override preserves the constructor parameter order shipped in 1.0.0 -- (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client -- orders the hoisted ``instance_id`` after ``credential``; restoring the original -- order here avoids a breaking change for existing callers. -- -- :param endpoint: The Device Update for IoT Hub account endpoint. Required. -- :type endpoint: str -- :param instance_id: The Device Update for IoT Hub account instance identifier. Required. -- :type instance_id: str -- :param credential: Credential used to authenticate requests to the service. Required. -- :type credential: ~azure.core.credentials.TokenCredential -- :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". -- Note that overriding this default value may result in unsupported behavior. -- :paramtype api_version: str -- """ -- -- def __init__( -- self, -- endpoint: str, -- instance_id: str, -- credential: "TokenCredential", -- *, -- api_version: Optional[str] = None, -- **kwargs: Any, -- ) -> None: -- if api_version is not None: -- kwargs["api_version"] = api_version -- super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) -- -- --__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level -+__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - - def patch_sdk(): -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py -index bd5b9caf10..1934415c13 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/model_base.py -@@ -109,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: - return encoded - - -+def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): -+ """Serialize a timedelta to its wire representation. -+ -+ For the ``seconds``/``milliseconds`` encodings the value is converted to a -+ numeric value, otherwise it falls back to an ISO 8601 duration string. -+ -+ :param timedelta td: The timedelta to serialize. -+ :param str format: The duration encoding format. -+ :rtype: int or float or str -+ :return: serialized duration -+ """ -+ seconds = td.total_seconds() -+ if format == "duration-seconds-int": -+ return int(seconds) -+ if format == "duration-seconds-float": -+ return seconds -+ if format == "duration-milliseconds-int": -+ return int(seconds * 1000) -+ if format == "duration-milliseconds-float": -+ return seconds * 1000 -+ return _timedelta_as_isostr(td) -+ -+ - def _serialize_datetime(o, format: typing.Optional[str] = None): - if hasattr(o, "year") and hasattr(o, "hour"): - if format == "rfc7231": -@@ -301,6 +324,12 @@ def _deserialize_duration(attr): - return isodate.parse_duration(attr) - - -+def _deserialize_duration_numeric(attr, unit): -+ if isinstance(attr, timedelta): -+ return attr -+ return timedelta(**{unit: float(attr)}) -+ -+ - def _deserialize_decimal(attr): - if isinstance(attr, decimal.Decimal): - return attr -@@ -330,6 +359,10 @@ _DESERIALIZE_MAPPING_WITHFORMAT = { - "unix-timestamp": _deserialize_datetime_unix_timestamp, - "base64": _deserialize_bytes, - "base64url": _deserialize_bytes_base64, -+ "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), -+ "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), -+ "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), -+ "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), - } - - -@@ -425,21 +458,21 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): - - def keys(self) -> typing.KeysView[str]: - """ -- :returns: a set-like object providing a view on D's keys -+ :returns: a set-like object providing a view on the mapping's keys - :rtype: ~typing.KeysView - """ - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - """ -- :returns: an object providing a view on D's values -+ :returns: an object providing a view on the mapping's values - :rtype: ~typing.ValuesView - """ - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - """ -- :returns: set-like object providing a view on D's items -+ :returns: a set-like object providing a view on the mapping's items - :rtype: ~typing.ItemsView - """ - return self._data.items() -@@ -449,7 +482,7 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): - Get the value for key if key is in the dictionary, else default. - :param str key: The key to look up. - :param any default: The value to return if key is not in the dictionary. Defaults to None -- :returns: D[k] if k in D, else d. -+ :returns: The value for key if key is in the dictionary, else default. - :rtype: any - """ - try: -@@ -484,19 +517,19 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): - Removes and returns some (key, value) pair - :returns: The (key, value) pair. - :rtype: tuple -- :raises KeyError: if D is empty. -+ :raises KeyError: if the dictionary is empty. - """ - return self._data.popitem() - - def clear(self) -> None: - """ -- Remove all items from D. -+ Remove all items from the dictionary. - """ - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ - """ -- Updates D from mapping/iterable E and F. -+ Update the dictionary from a mapping or an iterable of key-value pairs. - :param any args: Either a mapping object or an iterable of key-value pairs. - """ - self._data.update(*args, **kwargs) -@@ -509,10 +542,11 @@ class _MyMutableMapping(MutableMapping[str, typing.Any]): - - def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: - """ -- Same as calling D.get(k, d), and setting D[k]=d if k not found -+ Return the value for key if key is in the dictionary; otherwise set the key to -+ default and return default. - :param str key: The key to look up. - :param any default: The value to set if key is not in the dictionary -- :returns: D[k] if k in D, else d. -+ :returns: The value for key if key is in the dictionary, else default. - :rtype: any - """ - if default is _UNSET: -@@ -564,7 +598,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m - pass - # Last, try datetime.timedelta - try: -- return _timedelta_as_isostr(o) -+ return _serialize_duration(o, format) - except AttributeError: - # This will be raised when it hits value.total_seconds in the method above - pass -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py -index a088671e9c..75906e2eb7 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_utils/serialization.py -@@ -520,6 +520,10 @@ class Serializer: # pylint: disable=too-many-public-methods - "rfc-1123": Serializer.serialize_rfc, - "unix-time": Serializer.serialize_unix, - "duration": Serializer.serialize_duration, -+ "duration-seconds-int": Serializer.serialize_duration_seconds_int, -+ "duration-seconds-float": Serializer.serialize_duration_seconds_float, -+ "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, -+ "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, - "date": Serializer.serialize_date, - "time": Serializer.serialize_time, - "decimal": Serializer.serialize_decimal, -@@ -1109,6 +1113,61 @@ class Serializer: # pylint: disable=too-many-public-methods - attr = isodate.parse_duration(attr) - return isodate.duration_isoformat(attr) - -+ @staticmethod -+ def _serialize_duration_numeric(attr, scale, as_int): -+ """Serialize a TimeDelta into a numeric value scaled to the wire unit. -+ -+ :param TimeDelta attr: Object to be serialized. -+ :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). -+ :param bool as_int: Whether to truncate the result to an int. -+ :rtype: int or float -+ :return: serialized duration -+ """ -+ if isinstance(attr, str): -+ attr = isodate.parse_duration(attr) -+ value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr -+ return int(value) if as_int else float(value) -+ -+ @staticmethod -+ def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument -+ """Serialize TimeDelta object into an integer number of seconds. -+ -+ :param TimeDelta attr: Object to be serialized. -+ :rtype: int -+ :return: serialized duration -+ """ -+ return Serializer._serialize_duration_numeric(attr, 1, True) -+ -+ @staticmethod -+ def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument -+ """Serialize TimeDelta object into a floating point number of seconds. -+ -+ :param TimeDelta attr: Object to be serialized. -+ :rtype: float -+ :return: serialized duration -+ """ -+ return Serializer._serialize_duration_numeric(attr, 1, False) -+ -+ @staticmethod -+ def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument -+ """Serialize TimeDelta object into an integer number of milliseconds. -+ -+ :param TimeDelta attr: Object to be serialized. -+ :rtype: int -+ :return: serialized duration -+ """ -+ return Serializer._serialize_duration_numeric(attr, 1000, True) -+ -+ @staticmethod -+ def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument -+ """Serialize TimeDelta object into a floating point number of milliseconds. -+ -+ :param TimeDelta attr: Object to be serialized. -+ :rtype: float -+ :return: serialized duration -+ """ -+ return Serializer._serialize_duration_numeric(attr, 1000, False) -+ - @staticmethod - def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument - """Serialize Datetime object into RFC-1123 formatted string. -@@ -1381,6 +1440,10 @@ class Deserializer: - "rfc-1123": Deserializer.deserialize_rfc, - "unix-time": Deserializer.deserialize_unix, - "duration": Deserializer.deserialize_duration, -+ "duration-seconds-int": Deserializer.deserialize_duration_seconds, -+ "duration-seconds-float": Deserializer.deserialize_duration_seconds, -+ "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, -+ "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, - "date": Deserializer.deserialize_date, - "time": Deserializer.deserialize_time, - "decimal": Deserializer.deserialize_decimal, -@@ -1393,6 +1456,10 @@ class Deserializer: - } - self.deserialize_expected_types = { - "duration": (isodate.Duration, datetime.timedelta), -+ "duration-seconds-int": (isodate.Duration, datetime.timedelta), -+ "duration-seconds-float": (isodate.Duration, datetime.timedelta), -+ "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), -+ "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), - "iso-8601": (datetime.datetime), - } - self.dependencies: dict[str, type] = dict(classes) if classes else {} -@@ -1954,6 +2021,48 @@ class Deserializer: - raise DeserializationError(msg) from err - return duration - -+ @staticmethod -+ def _deserialize_duration_numeric(attr, unit): -+ """Deserialize a numeric duration value into a TimeDelta object. -+ -+ :param float attr: response value to be deserialized. -+ :param str unit: The wire unit, used as the ``timedelta`` keyword -+ (``"seconds"`` or ``"milliseconds"``). -+ :return: Deserialized duration -+ :rtype: TimeDelta -+ :raises DeserializationError: if value is invalid. -+ """ -+ if isinstance(attr, ET.Element): -+ attr = attr.text -+ try: -+ duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore -+ except (ValueError, OverflowError, TypeError) as err: -+ msg = "Cannot deserialize duration object." -+ raise DeserializationError(msg) from err -+ return duration -+ -+ @staticmethod -+ def deserialize_duration_seconds(attr): -+ """Deserialize a numeric number of seconds into a TimeDelta object. -+ -+ :param float attr: response value to be deserialized. -+ :return: Deserialized duration -+ :rtype: TimeDelta -+ :raises DeserializationError: if value is invalid. -+ """ -+ return Deserializer._deserialize_duration_numeric(attr, "seconds") -+ -+ @staticmethod -+ def deserialize_duration_milliseconds(attr): -+ """Deserialize a numeric number of milliseconds into a TimeDelta object. -+ -+ :param float attr: response value to be deserialized. -+ :return: Deserialized duration -+ :rtype: TimeDelta -+ :raises DeserializationError: if value is invalid. -+ """ -+ return Deserializer._deserialize_duration_numeric(attr, "milliseconds") -+ - @staticmethod - def deserialize_date(attr): - """Deserialize ISO-8601 formatted string into Date object. -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py -index 0d79358c1d..a9f9801b41 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_client.py -@@ -28,12 +28,7 @@ if TYPE_CHECKING: - - - class DeviceUpdateClient: -- """Device Update for IoT Hub is an Azure service that enables customers to publish updates for -- their IoT devices to the cloud, and then deploy that update to their devices (approve updates -- to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and -- reliability of the Windows Update platform, optimized for IoT devices. It works globally and -- knows when and how to update devices, enabling customers to focus on their business goals and -- let Device Update for IoT Hub handle the updates. -+ """DeviceUpdateClient. - - :ivar device_update: DeviceUpdateOperations operations - :vartype device_update: azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations -@@ -109,7 +104,7 @@ class DeviceUpdateClient: - - request_copy = deepcopy(request) - path_format_arguments = { -- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), -+ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - } - - request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py -index 4ba8e0abc8..39d2645ab5 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_configuration.py -@@ -29,9 +29,9 @@ class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attr - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param instance_id: The Device Update for IoT Hub account instance identifier. Required. - :type instance_id: str -- :keyword api_version: The API version to use for this operation. Known values are "2026-06-01". -- Default value is "2026-06-01". Note that overriding this default value may result in unsupported -- behavior. -+ :keyword api_version: The API version to use for this operation. Known values are "2026-06-01" -+ and None. Default value is None. If not set, the operation's default API version will be used. -+ Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py -index 73feb5caa7..87676c65a8 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py -@@ -8,48 +8,8 @@ - Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize - """ - --from typing import Any, List, Optional, TYPE_CHECKING - --from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated -- --if TYPE_CHECKING: -- from azure.core.credentials_async import AsyncTokenCredential -- -- --class DeviceUpdateClient(DeviceUpdateClientGenerated): -- """Device Update for IoT Hub async client. -- -- This override preserves the constructor parameter order shipped in 1.0.0 -- (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client -- orders the hoisted ``instance_id`` after ``credential``; restoring the original -- order here avoids a breaking change for existing callers. -- -- :param endpoint: The Device Update for IoT Hub account endpoint. Required. -- :type endpoint: str -- :param instance_id: The Device Update for IoT Hub account instance identifier. Required. -- :type instance_id: str -- :param credential: Credential used to authenticate requests to the service. Required. -- :type credential: ~azure.core.credentials_async.AsyncTokenCredential -- :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". -- Note that overriding this default value may result in unsupported behavior. -- :paramtype api_version: str -- """ -- -- def __init__( -- self, -- endpoint: str, -- instance_id: str, -- credential: "AsyncTokenCredential", -- *, -- api_version: Optional[str] = None, -- **kwargs: Any, -- ) -> None: -- if api_version is not None: -- kwargs["api_version"] = api_version -- super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) -- -- --__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level -+__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - - def patch_sdk(): -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py -index 47aaedcfd5..72351924fa 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_operations.py -@@ -33,7 +33,7 @@ from azure.core.tracing.decorator import distributed_trace - from azure.core.tracing.decorator_async import distributed_trace_async - from azure.core.utils import case_insensitive_dict - --from ... import models as _models -+from ... import models as _models, types as _types - from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize - from ..._utils.serialization import Deserializer, Serializer - from ...operations._operations import ( -@@ -90,7 +90,6 @@ from ...operations._operations import ( - ) - from .._configuration import DeviceUpdateClientConfiguration - --JSON = MutableMapping[str, Any] - T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] - -@@ -210,7 +209,9 @@ class DeviceUpdateOperations: - return AsyncItemPaged(get_next, extract_data) - - async def _import_update_initial( -- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any -+ self, -+ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], -+ **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, -@@ -305,7 +306,11 @@ class DeviceUpdateOperations: - - @overload - async def begin_import_update( -- self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any -+ self, -+ update_to_import: list[_types.ImportUpdateInputItem], -+ *, -+ content_type: str = "application/json", -+ **kwargs: Any - ) -> AsyncLROPoller[None]: - """Import new update version. This is a long-running-operation; use Operation-Location response - header value to check for operation status. -@@ -314,7 +319,7 @@ class DeviceUpdateOperations: - `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json - `_ for - details). Required. -- :type update_to_import: list[JSON] -+ :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str -@@ -345,7 +350,9 @@ class DeviceUpdateOperations: - - @distributed_trace_async - async def begin_import_update( -- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any -+ self, -+ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], -+ **kwargs: Any - ) -> AsyncLROPoller[None]: - """Import new update version. This is a long-running-operation; use Operation-Location response - header value to check for operation status. -@@ -353,9 +360,9 @@ class DeviceUpdateOperations: - :param update_to_import: The update to be imported (see schema - `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json - `_ for -- details). Is one of the following types: [ImportUpdateInputItem], [JSON], IO[bytes] Required. -+ details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. - :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or -- list[JSON] or IO[bytes] -+ list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: -@@ -1498,7 +1505,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - async def update_device_class( - self, - device_class_id: str, -- device_class_patch: JSON, -+ device_class_patch: _types.PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any -@@ -1510,7 +1517,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :param device_class_patch: The device class json merge patch body. Currently only supports - patching - friendlyName. Required. -- :type device_class_patch: JSON -+ :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str -@@ -1546,7 +1553,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @distributed_trace_async - async def update_device_class( -- self, device_class_id: str, device_class_patch: Union[_models.PatchBody, JSON, IO[bytes]], **kwargs: Any -+ self, -+ device_class_id: str, -+ device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], -+ **kwargs: Any - ) -> _models.DeviceClass: - """Update device class details. - -@@ -1554,8 +1564,9 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :type device_class_id: str - :param device_class_patch: The device class json merge patch body. Currently only supports - patching -- friendlyName. Is one of the following types: PatchBody, JSON, IO[bytes] Required. -- :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or JSON or IO[bytes] -+ friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. -+ :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or -+ ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass - :raises ~azure.core.exceptions.HttpResponseError: -@@ -2775,7 +2786,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - self, - group_id: str, - deployment_id: str, -- deployment: JSON, -+ deployment: _types.Deployment, - *, - content_type: str = "application/json", - **kwargs: Any -@@ -2787,7 +2798,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :param deployment: The deployment properties. Required. -- :type deployment: JSON -+ :type deployment: ~azure.iot.deviceupdate.types.Deployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str -@@ -2824,7 +2835,11 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @distributed_trace_async - async def create_or_update_deployment( -- self, group_id: str, deployment_id: str, deployment: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any -+ self, -+ group_id: str, -+ deployment_id: str, -+ deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], -+ **kwargs: Any - ) -> _models.Deployment: - """Creates or updates a deployment. - -@@ -2832,9 +2847,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :type group_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str -- :param deployment: The deployment properties. Is one of the following types: Deployment, JSON, -- IO[bytes] Required. -- :type deployment: ~azure.iot.deviceupdate.models.Deployment or JSON or IO[bytes] -+ :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. -+ Required. -+ :type deployment: ~azure.iot.deviceupdate.models.Deployment or -+ ~azure.iot.deviceupdate.types.Deployment or IO[bytes] - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment - :raises ~azure.core.exceptions.HttpResponseError: -@@ -2906,6 +2922,62 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - return deserialized # type: ignore - -+ @distributed_trace_async -+ async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> None: -+ """Deletes a deployment. -+ -+ :param group_id: Group identifier. Required. -+ :type group_id: str -+ :param deployment_id: Deployment identifier. Required. -+ :type deployment_id: str -+ :return: None -+ :rtype: None -+ :raises ~azure.core.exceptions.HttpResponseError: -+ """ -+ error_map: MutableMapping = { -+ 401: ClientAuthenticationError, -+ 404: ResourceNotFoundError, -+ 409: ResourceExistsError, -+ 304: ResourceNotModifiedError, -+ } -+ error_map.update(kwargs.pop("error_map", {}) or {}) -+ -+ _headers = kwargs.pop("headers", {}) or {} -+ _params = kwargs.pop("params", {}) or {} -+ -+ cls: ClsType[None] = kwargs.pop("cls", None) -+ -+ _request = build_device_management_delete_deployment_request( -+ group_id=group_id, -+ deployment_id=deployment_id, -+ instance_id=self._config.instance_id, -+ api_version=self._config.api_version, -+ headers=_headers, -+ params=_params, -+ ) -+ path_format_arguments = { -+ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -+ } -+ _request.url = self._client.format_url(_request.url, **path_format_arguments) -+ -+ _stream = False -+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access -+ _request, stream=_stream, **kwargs -+ ) -+ -+ response = pipeline_response.http_response -+ -+ if response.status_code not in [204]: -+ map_error(status_code=response.status_code, response=response, error_map=error_map) -+ error = _failsafe_deserialize( -+ _models.ErrorResponse, -+ response, -+ ) -+ raise HttpResponseError(response=response, model=error) -+ -+ if cls: -+ return cls(pipeline_response, None, {}) # type: ignore -+ - @distributed_trace_async - async def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: - """Gets the status of a deployment including a breakdown of how many devices in the deployment are -@@ -3533,6 +3605,67 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - return deserialized # type: ignore - -+ @distributed_trace_async -+ async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-too-long -+ self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any -+ ) -> None: -+ """Deletes a device class subgroup deployment. -+ -+ :param group_id: Group identifier. Required. -+ :type group_id: str -+ :param device_class_id: Device class identifier. Required. -+ :type device_class_id: str -+ :param deployment_id: Deployment identifier. Required. -+ :type deployment_id: str -+ :return: None -+ :rtype: None -+ :raises ~azure.core.exceptions.HttpResponseError: -+ """ -+ error_map: MutableMapping = { -+ 401: ClientAuthenticationError, -+ 404: ResourceNotFoundError, -+ 409: ResourceExistsError, -+ 304: ResourceNotModifiedError, -+ } -+ error_map.update(kwargs.pop("error_map", {}) or {}) -+ -+ _headers = kwargs.pop("headers", {}) or {} -+ _params = kwargs.pop("params", {}) or {} -+ -+ cls: ClsType[None] = kwargs.pop("cls", None) -+ -+ _request = build_device_management_delete_deployment_for_device_class_subgroup_request( -+ group_id=group_id, -+ device_class_id=device_class_id, -+ deployment_id=deployment_id, -+ instance_id=self._config.instance_id, -+ api_version=self._config.api_version, -+ headers=_headers, -+ params=_params, -+ ) -+ path_format_arguments = { -+ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -+ } -+ _request.url = self._client.format_url(_request.url, **path_format_arguments) -+ -+ _stream = False -+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access -+ _request, stream=_stream, **kwargs -+ ) -+ -+ response = pipeline_response.http_response -+ -+ if response.status_code not in [204]: -+ map_error(status_code=response.status_code, response=response, error_map=error_map) -+ error = _failsafe_deserialize( -+ _models.ErrorResponse, -+ response, -+ ) -+ raise HttpResponseError(response=response, model=error) -+ -+ if cls: -+ return cls(pipeline_response, None, {}) # type: ignore -+ - @distributed_trace_async - async def stop_deployment( - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any -@@ -4078,14 +4211,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @overload - async def start_log_collection( -- self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any -+ self, -+ log_collection_id: str, -+ log_collection: _types.LogCollection, -+ *, -+ content_type: str = "application/json", -+ **kwargs: Any - ) -> _models.LogCollection: - """Start the device diagnostics log collection on specified devices. - - :param log_collection_id: Log collection identifier. Required. - :type log_collection_id: str - :param log_collection: The log collection properties. Required. -- :type log_collection: JSON -+ :type log_collection: ~azure.iot.deviceupdate.types.LogCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str -@@ -4119,15 +4257,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @distributed_trace_async - async def start_log_collection( -- self, log_collection_id: str, log_collection: Union[_models.LogCollection, JSON, IO[bytes]], **kwargs: Any -+ self, -+ log_collection_id: str, -+ log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], -+ **kwargs: Any - ) -> _models.LogCollection: - """Start the device diagnostics log collection on specified devices. - - :param log_collection_id: Log collection identifier. Required. - :type log_collection_id: str -- :param log_collection: The log collection properties. Is one of the following types: -- LogCollection, JSON, IO[bytes] Required. -- :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or JSON or IO[bytes] -+ :param log_collection: The log collection properties. Is either a LogCollection type or a -+ IO[bytes] type. Required. -+ :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or -+ ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection - :raises ~azure.core.exceptions.HttpResponseError: -@@ -4514,120 +4656,3 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) -- -- @distributed_trace_async -- async def delete_deployment(self, group_id: str, deployment_id: str, **kwargs: Any) -> None: -- """Deletes a deployment. -- -- :param group_id: Group identifier. Required. -- :type group_id: str -- :param deployment_id: Deployment identifier. Required. -- :type deployment_id: str -- :return: None -- :rtype: None -- :raises ~azure.core.exceptions.HttpResponseError: -- """ -- error_map: MutableMapping = { -- 401: ClientAuthenticationError, -- 404: ResourceNotFoundError, -- 409: ResourceExistsError, -- 304: ResourceNotModifiedError, -- } -- error_map.update(kwargs.pop("error_map", {}) or {}) -- -- _headers = kwargs.pop("headers", {}) or {} -- _params = kwargs.pop("params", {}) or {} -- -- cls: ClsType[None] = kwargs.pop("cls", None) -- -- _request = build_device_management_delete_deployment_request( -- group_id=group_id, -- deployment_id=deployment_id, -- instance_id=self._config.instance_id, -- api_version=self._config.api_version, -- headers=_headers, -- params=_params, -- ) -- path_format_arguments = { -- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -- } -- _request.url = self._client.format_url(_request.url, **path_format_arguments) -- -- _stream = False -- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access -- _request, stream=_stream, **kwargs -- ) -- -- response = pipeline_response.http_response -- -- if response.status_code not in [204]: -- map_error(status_code=response.status_code, response=response, error_map=error_map) -- error = _failsafe_deserialize( -- _models.ErrorResponse, -- response, -- ) -- raise HttpResponseError(response=response, model=error) -- -- if cls: -- return cls(pipeline_response, None, {}) # type: ignore -- -- @distributed_trace_async -- async def delete_deployment_for_device_class_subgroup( # pylint: disable=name-too-long -- self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any -- ) -> None: -- """Deletes a device class subgroup deployment. -- -- :param group_id: Group identifier. Required. -- :type group_id: str -- :param device_class_id: Device class identifier. Required. -- :type device_class_id: str -- :param deployment_id: Deployment identifier. Required. -- :type deployment_id: str -- :return: None -- :rtype: None -- :raises ~azure.core.exceptions.HttpResponseError: -- """ -- error_map: MutableMapping = { -- 401: ClientAuthenticationError, -- 404: ResourceNotFoundError, -- 409: ResourceExistsError, -- 304: ResourceNotModifiedError, -- } -- error_map.update(kwargs.pop("error_map", {}) or {}) -- -- _headers = kwargs.pop("headers", {}) or {} -- _params = kwargs.pop("params", {}) or {} -- -- cls: ClsType[None] = kwargs.pop("cls", None) -- -- _request = build_device_management_delete_deployment_for_device_class_subgroup_request( -- group_id=group_id, -- device_class_id=device_class_id, -- deployment_id=deployment_id, -- instance_id=self._config.instance_id, -- api_version=self._config.api_version, -- headers=_headers, -- params=_params, -- ) -- path_format_arguments = { -- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -- } -- _request.url = self._client.format_url(_request.url, **path_format_arguments) -- -- _stream = False -- pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access -- _request, stream=_stream, **kwargs -- ) -- -- response = pipeline_response.http_response -- -- if response.status_code not in [204]: -- map_error(status_code=response.status_code, response=response, error_map=error_map) -- error = _failsafe_deserialize( -- _models.ErrorResponse, -- response, -- ) -- raise HttpResponseError(response=response, model=error) -- -- if cls: -- return cls(pipeline_response, None, {}) # type: ignore -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py -index 0cc0120119..87676c65a8 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py -@@ -8,94 +8,8 @@ - Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize - """ - --from typing import Any, List, Optional - --from azure.core import MatchConditions -- --from ._operations import ( -- DeviceManagementOperations as DeviceManagementOperationsGenerated, -- DeviceUpdateOperations as DeviceUpdateOperationsGenerated, --) -- -- --def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: -- """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw -- ``If-None-Match`` header value as-is (the generated client instead exposes the -- ``etag`` / ``match_condition`` pattern). -- -- :param kwargs: The keyword arguments forwarded to the generated operation. -- :type kwargs: any -- :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. -- :type if_none_match: str or None -- """ -- if if_none_match is not None: -- headers = kwargs.setdefault("headers", {}) -- headers.setdefault("If-None-Match", if_none_match) -- -- --class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): -- async def get_update( -- self, -- provider: str, -- name: str, -- version: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return await super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) -- -- async def get_file( -- self, -- provider: str, -- name: str, -- version: str, -- file_id: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return await super().get_file( -- provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs -- ) -- -- async def get_operation_status( -- self, -- operation_id: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) -- -- --class DeviceManagementOperations(DeviceManagementOperationsGenerated): -- async def get_operation_status( -- self, -- operation_id: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) -- -- --__all__: List[str] = [ -- "DeviceUpdateOperations", -- "DeviceManagementOperations", --] # Add all objects you want publicly available at this package level -+__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - - def patch_sdk(): -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py -index 44b7f9e907..399aa0d59b 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_operations.py -@@ -32,13 +32,12 @@ from azure.core.rest import HttpRequest, HttpResponse - from azure.core.tracing.decorator import distributed_trace - from azure.core.utils import case_insensitive_dict - --from .. import models as _models -+from .. import models as _models, types as _types - from .._configuration import DeviceUpdateClientConfiguration - from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize - from .._utils.serialization import Deserializer, Serializer - from .._utils.utils import prep_if_match, prep_if_none_match - --JSON = MutableMapping[str, Any] - T = TypeVar("T") - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] - -@@ -877,6 +876,28 @@ def build_device_management_create_or_update_deployment_request( # pylint: disa - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -+def build_device_management_delete_deployment_request( # pylint: disable=name-too-long -+ group_id: str, deployment_id: str, instance_id: str, **kwargs: Any -+) -> HttpRequest: -+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) -+ -+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) -+ # Construct URL -+ _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}" -+ path_format_arguments = { -+ "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), -+ "groupId": _SERIALIZER.url("group_id", group_id, "str"), -+ "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), -+ } -+ -+ _url: str = _url.format(**path_format_arguments) # type: ignore -+ -+ # Construct parameters -+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -+ -+ return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -+ -+ - def build_device_management_get_deployment_status_request( # pylint: disable=name-too-long - group_id: str, deployment_id: str, instance_id: str, **kwargs: Any - ) -> HttpRequest: -@@ -1101,6 +1122,29 @@ def build_device_management_get_deployment_for_device_class_subgroup_request( # - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -+def build_device_management_delete_deployment_for_device_class_subgroup_request( # pylint: disable=name-too-long -+ group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any -+) -> HttpRequest: -+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) -+ -+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) -+ # Construct URL -+ _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}" -+ path_format_arguments = { -+ "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), -+ "groupId": _SERIALIZER.url("group_id", group_id, "str"), -+ "deviceClassId": _SERIALIZER.url("device_class_id", device_class_id, "str"), -+ "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), -+ } -+ -+ _url: str = _url.format(**path_format_arguments) # type: ignore -+ -+ # Construct parameters -+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -+ -+ return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -+ -+ - def build_device_management_stop_deployment_request( # pylint: disable=name-too-long - group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any - ) -> HttpRequest: -@@ -1430,51 +1474,6 @@ def build_device_management_list_health_of_devices_request( # pylint: disable=n - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - --def build_device_management_delete_deployment_request( # pylint: disable=name-too-long -- group_id: str, deployment_id: str, instance_id: str, **kwargs: Any --) -> HttpRequest: -- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) -- -- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) -- # Construct URL -- _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}" -- path_format_arguments = { -- "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), -- "groupId": _SERIALIZER.url("group_id", group_id, "str"), -- "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), -- } -- -- _url: str = _url.format(**path_format_arguments) # type: ignore -- -- # Construct parameters -- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -- -- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -- -- --def build_device_management_delete_deployment_for_device_class_subgroup_request( # pylint: disable=name-too-long -- group_id: str, device_class_id: str, deployment_id: str, instance_id: str, **kwargs: Any --) -> HttpRequest: -- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) -- -- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01")) -- # Construct URL -- _url = "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}" -- path_format_arguments = { -- "instanceId": _SERIALIZER.url("instance_id", instance_id, "str"), -- "groupId": _SERIALIZER.url("group_id", group_id, "str"), -- "deviceClassId": _SERIALIZER.url("device_class_id", device_class_id, "str"), -- "deploymentId": _SERIALIZER.url("deployment_id", deployment_id, "str"), -- } -- -- _url: str = _url.format(**path_format_arguments) # type: ignore -- -- # Construct parameters -- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") -- -- return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -- -- - class DeviceUpdateOperations: - """ - .. warning:: -@@ -1590,7 +1589,9 @@ class DeviceUpdateOperations: - return ItemPaged(get_next, extract_data) - - def _import_update_initial( -- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any -+ self, -+ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], -+ **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, -@@ -1685,7 +1686,11 @@ class DeviceUpdateOperations: - - @overload - def begin_import_update( -- self, update_to_import: list[JSON], *, content_type: str = "application/json", **kwargs: Any -+ self, -+ update_to_import: list[_types.ImportUpdateInputItem], -+ *, -+ content_type: str = "application/json", -+ **kwargs: Any - ) -> LROPoller[None]: - """Import new update version. This is a long-running-operation; use Operation-Location response - header value to check for operation status. -@@ -1694,7 +1699,7 @@ class DeviceUpdateOperations: - `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json - `_ for - details). Required. -- :type update_to_import: list[JSON] -+ :type update_to_import: list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str -@@ -1725,7 +1730,9 @@ class DeviceUpdateOperations: - - @distributed_trace - def begin_import_update( -- self, update_to_import: Union[list[_models.ImportUpdateInputItem], list[JSON], IO[bytes]], **kwargs: Any -+ self, -+ update_to_import: Union[list[_models.ImportUpdateInputItem], list[_types.ImportUpdateInputItem], IO[bytes]], -+ **kwargs: Any - ) -> LROPoller[None]: - """Import new update version. This is a long-running-operation; use Operation-Location response - header value to check for operation status. -@@ -1733,9 +1740,9 @@ class DeviceUpdateOperations: - :param update_to_import: The update to be imported (see schema - `https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json - `_ for -- details). Is one of the following types: [ImportUpdateInputItem], [JSON], IO[bytes] Required. -+ details). Is either a [ImportUpdateInputItem] type or a IO[bytes] type. Required. - :type update_to_import: list[~azure.iot.deviceupdate.models.ImportUpdateInputItem] or -- list[JSON] or IO[bytes] -+ list[~azure.iot.deviceupdate.types.ImportUpdateInputItem] or IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: -@@ -2870,7 +2877,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - def update_device_class( - self, - device_class_id: str, -- device_class_patch: JSON, -+ device_class_patch: _types.PatchBody, - *, - content_type: str = "application/merge-patch+json", - **kwargs: Any -@@ -2882,7 +2889,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :param device_class_patch: The device class json merge patch body. Currently only supports - patching - friendlyName. Required. -- :type device_class_patch: JSON -+ :type device_class_patch: ~azure.iot.deviceupdate.types.PatchBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/merge-patch+json". - :paramtype content_type: str -@@ -2918,7 +2925,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @distributed_trace - def update_device_class( -- self, device_class_id: str, device_class_patch: Union[_models.PatchBody, JSON, IO[bytes]], **kwargs: Any -+ self, -+ device_class_id: str, -+ device_class_patch: Union[_models.PatchBody, _types.PatchBody, IO[bytes]], -+ **kwargs: Any - ) -> _models.DeviceClass: - """Update device class details. - -@@ -2926,8 +2936,9 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :type device_class_id: str - :param device_class_patch: The device class json merge patch body. Currently only supports - patching -- friendlyName. Is one of the following types: PatchBody, JSON, IO[bytes] Required. -- :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or JSON or IO[bytes] -+ friendlyName. Is either a PatchBody type or a IO[bytes] type. Required. -+ :type device_class_patch: ~azure.iot.deviceupdate.models.PatchBody or -+ ~azure.iot.deviceupdate.types.PatchBody or IO[bytes] - :return: DeviceClass. The DeviceClass is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.DeviceClass - :raises ~azure.core.exceptions.HttpResponseError: -@@ -4144,7 +4155,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - self, - group_id: str, - deployment_id: str, -- deployment: JSON, -+ deployment: _types.Deployment, - *, - content_type: str = "application/json", - **kwargs: Any -@@ -4156,7 +4167,7 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str - :param deployment: The deployment properties. Required. -- :type deployment: JSON -+ :type deployment: ~azure.iot.deviceupdate.types.Deployment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str -@@ -4193,7 +4204,11 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @distributed_trace - def create_or_update_deployment( -- self, group_id: str, deployment_id: str, deployment: Union[_models.Deployment, JSON, IO[bytes]], **kwargs: Any -+ self, -+ group_id: str, -+ deployment_id: str, -+ deployment: Union[_models.Deployment, _types.Deployment, IO[bytes]], -+ **kwargs: Any - ) -> _models.Deployment: - """Creates or updates a deployment. - -@@ -4201,9 +4216,10 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - :type group_id: str - :param deployment_id: Deployment identifier. Required. - :type deployment_id: str -- :param deployment: The deployment properties. Is one of the following types: Deployment, JSON, -- IO[bytes] Required. -- :type deployment: ~azure.iot.deviceupdate.models.Deployment or JSON or IO[bytes] -+ :param deployment: The deployment properties. Is either a Deployment type or a IO[bytes] type. -+ Required. -+ :type deployment: ~azure.iot.deviceupdate.models.Deployment or -+ ~azure.iot.deviceupdate.types.Deployment or IO[bytes] - :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.Deployment - :raises ~azure.core.exceptions.HttpResponseError: -@@ -4275,6 +4291,64 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - return deserialized # type: ignore - -+ @distributed_trace -+ def delete_deployment( # pylint: disable=inconsistent-return-statements -+ self, group_id: str, deployment_id: str, **kwargs: Any -+ ) -> None: -+ """Deletes a deployment. -+ -+ :param group_id: Group identifier. Required. -+ :type group_id: str -+ :param deployment_id: Deployment identifier. Required. -+ :type deployment_id: str -+ :return: None -+ :rtype: None -+ :raises ~azure.core.exceptions.HttpResponseError: -+ """ -+ error_map: MutableMapping = { -+ 401: ClientAuthenticationError, -+ 404: ResourceNotFoundError, -+ 409: ResourceExistsError, -+ 304: ResourceNotModifiedError, -+ } -+ error_map.update(kwargs.pop("error_map", {}) or {}) -+ -+ _headers = kwargs.pop("headers", {}) or {} -+ _params = kwargs.pop("params", {}) or {} -+ -+ cls: ClsType[None] = kwargs.pop("cls", None) -+ -+ _request = build_device_management_delete_deployment_request( -+ group_id=group_id, -+ deployment_id=deployment_id, -+ instance_id=self._config.instance_id, -+ api_version=self._config.api_version, -+ headers=_headers, -+ params=_params, -+ ) -+ path_format_arguments = { -+ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -+ } -+ _request.url = self._client.format_url(_request.url, **path_format_arguments) -+ -+ _stream = False -+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access -+ _request, stream=_stream, **kwargs -+ ) -+ -+ response = pipeline_response.http_response -+ -+ if response.status_code not in [204]: -+ map_error(status_code=response.status_code, response=response, error_map=error_map) -+ error = _failsafe_deserialize( -+ _models.ErrorResponse, -+ response, -+ ) -+ raise HttpResponseError(response=response, model=error) -+ -+ if cls: -+ return cls(pipeline_response, None, {}) # type: ignore -+ - @distributed_trace - def get_deployment_status(self, group_id: str, deployment_id: str, **kwargs: Any) -> _models.DeploymentStatus: - """Gets the status of a deployment including a breakdown of how many devices in the deployment are -@@ -4903,6 +4977,67 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - return deserialized # type: ignore - -+ @distributed_trace -+ def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent-return-statements,name-too-long -+ self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any -+ ) -> None: -+ """Deletes a device class subgroup deployment. -+ -+ :param group_id: Group identifier. Required. -+ :type group_id: str -+ :param device_class_id: Device class identifier. Required. -+ :type device_class_id: str -+ :param deployment_id: Deployment identifier. Required. -+ :type deployment_id: str -+ :return: None -+ :rtype: None -+ :raises ~azure.core.exceptions.HttpResponseError: -+ """ -+ error_map: MutableMapping = { -+ 401: ClientAuthenticationError, -+ 404: ResourceNotFoundError, -+ 409: ResourceExistsError, -+ 304: ResourceNotModifiedError, -+ } -+ error_map.update(kwargs.pop("error_map", {}) or {}) -+ -+ _headers = kwargs.pop("headers", {}) or {} -+ _params = kwargs.pop("params", {}) or {} -+ -+ cls: ClsType[None] = kwargs.pop("cls", None) -+ -+ _request = build_device_management_delete_deployment_for_device_class_subgroup_request( -+ group_id=group_id, -+ device_class_id=device_class_id, -+ deployment_id=deployment_id, -+ instance_id=self._config.instance_id, -+ api_version=self._config.api_version, -+ headers=_headers, -+ params=_params, -+ ) -+ path_format_arguments = { -+ "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -+ } -+ _request.url = self._client.format_url(_request.url, **path_format_arguments) -+ -+ _stream = False -+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access -+ _request, stream=_stream, **kwargs -+ ) -+ -+ response = pipeline_response.http_response -+ -+ if response.status_code not in [204]: -+ map_error(status_code=response.status_code, response=response, error_map=error_map) -+ error = _failsafe_deserialize( -+ _models.ErrorResponse, -+ response, -+ ) -+ raise HttpResponseError(response=response, model=error) -+ -+ if cls: -+ return cls(pipeline_response, None, {}) # type: ignore -+ - @distributed_trace - def stop_deployment( - self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any -@@ -5447,14 +5582,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @overload - def start_log_collection( -- self, log_collection_id: str, log_collection: JSON, *, content_type: str = "application/json", **kwargs: Any -+ self, -+ log_collection_id: str, -+ log_collection: _types.LogCollection, -+ *, -+ content_type: str = "application/json", -+ **kwargs: Any - ) -> _models.LogCollection: - """Start the device diagnostics log collection on specified devices. - - :param log_collection_id: Log collection identifier. Required. - :type log_collection_id: str - :param log_collection: The log collection properties. Required. -- :type log_collection: JSON -+ :type log_collection: ~azure.iot.deviceupdate.types.LogCollection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str -@@ -5488,15 +5628,19 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - - @distributed_trace - def start_log_collection( -- self, log_collection_id: str, log_collection: Union[_models.LogCollection, JSON, IO[bytes]], **kwargs: Any -+ self, -+ log_collection_id: str, -+ log_collection: Union[_models.LogCollection, _types.LogCollection, IO[bytes]], -+ **kwargs: Any - ) -> _models.LogCollection: - """Start the device diagnostics log collection on specified devices. - - :param log_collection_id: Log collection identifier. Required. - :type log_collection_id: str -- :param log_collection: The log collection properties. Is one of the following types: -- LogCollection, JSON, IO[bytes] Required. -- :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or JSON or IO[bytes] -+ :param log_collection: The log collection properties. Is either a LogCollection type or a -+ IO[bytes] type. Required. -+ :type log_collection: ~azure.iot.deviceupdate.models.LogCollection or -+ ~azure.iot.deviceupdate.types.LogCollection or IO[bytes] - :return: LogCollection. The LogCollection is compatible with MutableMapping - :rtype: ~azure.iot.deviceupdate.models.LogCollection - :raises ~azure.core.exceptions.HttpResponseError: -@@ -5883,122 +6027,3 @@ class DeviceManagementOperations: # pylint: disable=too-many-public-methods - return pipeline_response - - return ItemPaged(get_next, extract_data) -- -- @distributed_trace -- def delete_deployment( # pylint: disable=inconsistent-return-statements -- self, group_id: str, deployment_id: str, **kwargs: Any -- ) -> None: -- """Deletes a deployment. -- -- :param group_id: Group identifier. Required. -- :type group_id: str -- :param deployment_id: Deployment identifier. Required. -- :type deployment_id: str -- :return: None -- :rtype: None -- :raises ~azure.core.exceptions.HttpResponseError: -- """ -- error_map: MutableMapping = { -- 401: ClientAuthenticationError, -- 404: ResourceNotFoundError, -- 409: ResourceExistsError, -- 304: ResourceNotModifiedError, -- } -- error_map.update(kwargs.pop("error_map", {}) or {}) -- -- _headers = kwargs.pop("headers", {}) or {} -- _params = kwargs.pop("params", {}) or {} -- -- cls: ClsType[None] = kwargs.pop("cls", None) -- -- _request = build_device_management_delete_deployment_request( -- group_id=group_id, -- deployment_id=deployment_id, -- instance_id=self._config.instance_id, -- api_version=self._config.api_version, -- headers=_headers, -- params=_params, -- ) -- path_format_arguments = { -- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -- } -- _request.url = self._client.format_url(_request.url, **path_format_arguments) -- -- _stream = False -- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access -- _request, stream=_stream, **kwargs -- ) -- -- response = pipeline_response.http_response -- -- if response.status_code not in [204]: -- map_error(status_code=response.status_code, response=response, error_map=error_map) -- error = _failsafe_deserialize( -- _models.ErrorResponse, -- response, -- ) -- raise HttpResponseError(response=response, model=error) -- -- if cls: -- return cls(pipeline_response, None, {}) # type: ignore -- -- @distributed_trace -- def delete_deployment_for_device_class_subgroup( # pylint: disable=inconsistent-return-statements,name-too-long -- self, group_id: str, device_class_id: str, deployment_id: str, **kwargs: Any -- ) -> None: -- """Deletes a device class subgroup deployment. -- -- :param group_id: Group identifier. Required. -- :type group_id: str -- :param device_class_id: Device class identifier. Required. -- :type device_class_id: str -- :param deployment_id: Deployment identifier. Required. -- :type deployment_id: str -- :return: None -- :rtype: None -- :raises ~azure.core.exceptions.HttpResponseError: -- """ -- error_map: MutableMapping = { -- 401: ClientAuthenticationError, -- 404: ResourceNotFoundError, -- 409: ResourceExistsError, -- 304: ResourceNotModifiedError, -- } -- error_map.update(kwargs.pop("error_map", {}) or {}) -- -- _headers = kwargs.pop("headers", {}) or {} -- _params = kwargs.pop("params", {}) or {} -- -- cls: ClsType[None] = kwargs.pop("cls", None) -- -- _request = build_device_management_delete_deployment_for_device_class_subgroup_request( -- group_id=group_id, -- device_class_id=device_class_id, -- deployment_id=deployment_id, -- instance_id=self._config.instance_id, -- api_version=self._config.api_version, -- headers=_headers, -- params=_params, -- ) -- path_format_arguments = { -- "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), -- } -- _request.url = self._client.format_url(_request.url, **path_format_arguments) -- -- _stream = False -- pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access -- _request, stream=_stream, **kwargs -- ) -- -- response = pipeline_response.http_response -- -- if response.status_code not in [204]: -- map_error(status_code=response.status_code, response=response, error_map=error_map) -- error = _failsafe_deserialize( -- _models.ErrorResponse, -- response, -- ) -- raise HttpResponseError(response=response, model=error) -- -- if cls: -- return cls(pipeline_response, None, {}) # type: ignore -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py -index dd6b7c08ad..87676c65a8 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py -@@ -8,92 +8,8 @@ - Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize - """ - --from typing import Any, List, Optional - --from azure.core import MatchConditions -- --from ._operations import ( -- DeviceManagementOperations as DeviceManagementOperationsGenerated, -- DeviceUpdateOperations as DeviceUpdateOperationsGenerated, --) -- -- --def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: -- """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw -- ``If-None-Match`` header value as-is (the generated client instead exposes the -- ``etag`` / ``match_condition`` pattern). -- -- :param kwargs: The keyword arguments forwarded to the generated operation. -- :type kwargs: any -- :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. -- :type if_none_match: str or None -- """ -- if if_none_match is not None: -- headers = kwargs.setdefault("headers", {}) -- headers.setdefault("If-None-Match", if_none_match) -- -- --class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): -- def get_update( -- self, -- provider: str, -- name: str, -- version: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) -- -- def get_file( -- self, -- provider: str, -- name: str, -- version: str, -- file_id: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return super().get_file(provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs) -- -- def get_operation_status( -- self, -- operation_id: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) -- -- --class DeviceManagementOperations(DeviceManagementOperationsGenerated): -- def get_operation_status( -- self, -- operation_id: str, -- *, -- etag: Optional[str] = None, -- match_condition: Optional[MatchConditions] = None, -- if_none_match: Optional[str] = None, -- **kwargs: Any, -- ): -- _apply_if_none_match(kwargs, if_none_match) -- return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) -- -- --__all__: List[str] = [ -- "DeviceUpdateOperations", -- "DeviceManagementOperations", --] # Add all objects you want publicly available at this package level -+__all__: list[str] = [] # Add all objects you want publicly available to users at this package level - - - def patch_sdk(): -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py -new file mode 100644 -index 0000000000..c198e1ee1c ---- /dev/null -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/types.py -@@ -0,0 +1,269 @@ -+# coding=utf-8 -+# -------------------------------------------------------------------------- -+# Copyright (c) Microsoft Corporation. All rights reserved. -+# Licensed under the MIT License. See License.txt in the project root for license information. -+# Code generated by Microsoft (R) Python Code Generator. -+# Changes may cause incorrect behavior and will be lost if the code is regenerated. -+# -------------------------------------------------------------------------- -+ -+from typing import TYPE_CHECKING, Union -+from typing_extensions import Required, TypedDict -+ -+if TYPE_CHECKING: -+ from .models import DownloadSecurity, OperationStatus -+ -+ -+class CloudInitiatedRollbackPolicy(TypedDict, total=False): -+ """Rollback policy for deployment. -+ -+ :ivar update_property: Update to rollback to. Required. -+ :vartype update_property: "UpdateInfo" -+ :ivar failure: Failure conditions to initiate rollback policy. Required. -+ :vartype failure: "CloudInitiatedRollbackPolicyFailure" -+ """ -+ -+ update: Required["UpdateInfo"] -+ """Update to rollback to. Required.""" -+ failure: Required["CloudInitiatedRollbackPolicyFailure"] -+ """Failure conditions to initiate rollback policy. Required.""" -+ -+ -+class CloudInitiatedRollbackPolicyFailure(TypedDict, total=False): -+ """Failure conditions to initiate rollback policy. -+ -+ :ivar devices_failed_percentage: Percentage of devices that failed. Required. -+ :vartype devices_failed_percentage: int -+ :ivar devices_failed_count: Number of devices that failed. Required. -+ :vartype devices_failed_count: int -+ """ -+ -+ devicesFailedPercentage: Required[int] -+ """Percentage of devices that failed. Required.""" -+ devicesFailedCount: Required[int] -+ """Number of devices that failed. Required.""" -+ -+ -+class Deployment(TypedDict, total=False): -+ """Deployment metadata. -+ -+ :ivar deployment_id: The caller-provided deployment identifier. This cannot be longer than 73 -+ characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', -+ '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub -+ resource generates a GUID for deploymentId when you create a deployment. Required. -+ :vartype deployment_id: str -+ :ivar start_date_time: The deployment start datetime. Required. -+ :vartype start_date_time: str -+ :ivar update_property: Update information for the update in the deployment. Required. -+ :vartype update_property: "UpdateInfo" -+ :ivar group_id: The group identity for the devices the deployment is intended to update. -+ Required. -+ :vartype group_id: str -+ :ivar device_class_subgroups: The device class subgroups the deployment is compatible with and -+ subgroup deployments have been created for. This is not provided by the caller during -+ CreateOrUpdateDeployment but is automatically determined by Device Update. -+ :vartype device_class_subgroups: list[str] -+ :ivar is_canceled: Boolean flag indicating whether the deployment was canceled. -+ :vartype is_canceled: bool -+ :ivar is_retried: Boolean flag indicating whether the deployment has been retried. -+ :vartype is_retried: bool -+ :ivar rollback_policy: The rollback policy for the deployment. -+ :vartype rollback_policy: "CloudInitiatedRollbackPolicy" -+ :ivar is_cloud_initiated_rollback: Boolean flag indicating whether the deployment is a rollback -+ deployment. -+ :vartype is_cloud_initiated_rollback: bool -+ :ivar download_security: The protocol the device should use when downloading the update -+ payload. Defaults to "https". Known values are: "https" and "http". -+ :vartype download_security: Union[str, "DownloadSecurity"] -+ """ -+ -+ deploymentId: Required[str] -+ """The caller-provided deployment identifier. This cannot be longer than 73 characters, must be -+ all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, -+ backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a -+ GUID for deploymentId when you create a deployment. Required.""" -+ startDateTime: Required[str] -+ """The deployment start datetime. Required.""" -+ update: Required["UpdateInfo"] -+ """Update information for the update in the deployment. Required.""" -+ groupId: Required[str] -+ """The group identity for the devices the deployment is intended to update. Required.""" -+ deviceClassSubgroups: list[str] -+ """The device class subgroups the deployment is compatible with and subgroup deployments have been -+ created for. This is not provided by the caller during CreateOrUpdateDeployment but is -+ automatically determined by Device Update.""" -+ isCanceled: bool -+ """Boolean flag indicating whether the deployment was canceled.""" -+ isRetried: bool -+ """Boolean flag indicating whether the deployment has been retried.""" -+ rollbackPolicy: "CloudInitiatedRollbackPolicy" -+ """The rollback policy for the deployment.""" -+ isCloudInitiatedRollback: bool -+ """Boolean flag indicating whether the deployment is a rollback deployment.""" -+ downloadSecurity: Union[str, "DownloadSecurity"] -+ """The protocol the device should use when downloading the update payload. Defaults to \"https\". -+ Known values are: \"https\" and \"http\".""" -+ -+ -+class DeviceUpdateAgentId(TypedDict, total=False): -+ """Device Update agent id. -+ -+ :ivar device_id: Device Id. Required. -+ :vartype device_id: str -+ :ivar module_id: Module Id. -+ :vartype module_id: str -+ """ -+ -+ deviceId: Required[str] -+ """Device Id. Required.""" -+ moduleId: str -+ """Module Id.""" -+ -+ -+class FileImportMetadata(TypedDict, total=False): -+ """Metadata describing an update file. -+ -+ :ivar filename: Update file name as specified inside import manifest. Required. -+ :vartype filename: str -+ :ivar url: Azure Blob location from which the update file can be downloaded by Device Update -+ for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at -+ least 4 hours. Required. -+ :vartype url: str -+ """ -+ -+ filename: Required[str] -+ """Update file name as specified inside import manifest. Required.""" -+ url: Required[str] -+ """Azure Blob location from which the update file can be downloaded by Device Update for IoT Hub. -+ This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 -+ hours. Required.""" -+ -+ -+class ImportManifestMetadata(TypedDict, total=False): -+ """Metadata describing the import manifest, a document which describes the files and other -+ metadata about an update version. -+ -+ :ivar url: Azure Blob location from which the import manifest can be downloaded by Device -+ Update for IoT Hub. This is typically a read-only SAS-protected blob URL with an expiration set -+ to at least 4 hours. Required. -+ :vartype url: str -+ :ivar size_in_bytes: File size in number of bytes. Required. -+ :vartype size_in_bytes: int -+ :ivar hashes: A JSON object containing the hash(es) of the file. At least SHA256 hash is -+ required. This object can be thought of as a set of key-value pairs where the key is the hash -+ algorithm, and the value is the hash of the file calculated using that algorithm. Required. -+ :vartype hashes: dict[str, str] -+ """ -+ -+ url: Required[str] -+ """Azure Blob location from which the import manifest can be downloaded by Device Update for IoT -+ Hub. This is typically a read-only SAS-protected blob URL with an expiration set to at least 4 -+ hours. Required.""" -+ sizeInBytes: Required[int] -+ """File size in number of bytes. Required.""" -+ hashes: Required[dict[str, str]] -+ """A JSON object containing the hash(es) of the file. At least SHA256 hash is required. This -+ object can be thought of as a set of key-value pairs where the key is the hash algorithm, and -+ the value is the hash of the file calculated using that algorithm. Required.""" -+ -+ -+class ImportUpdateInputItem(TypedDict, total=False): -+ """Import update input item metadata. -+ -+ :ivar import_manifest: Import manifest metadata like source URL, file size/hashes, etc. -+ Required. -+ :vartype import_manifest: "ImportManifestMetadata" -+ :ivar friendly_name: Friendly update name. -+ :vartype friendly_name: str -+ :ivar files: One or more update file properties like filename and source URL. -+ :vartype files: list["FileImportMetadata"] -+ """ -+ -+ importManifest: Required["ImportManifestMetadata"] -+ """Import manifest metadata like source URL, file size/hashes, etc. Required.""" -+ friendlyName: str -+ """Friendly update name.""" -+ files: list["FileImportMetadata"] -+ """One or more update file properties like filename and source URL.""" -+ -+ -+class LogCollection(TypedDict, total=False): -+ """Diagnostics request body. -+ -+ :ivar log_collection_id: The log collection id. -+ :vartype log_collection_id: str -+ :ivar device_list: Array of Device Update agent ids. Required. -+ :vartype device_list: list["DeviceUpdateAgentId"] -+ :ivar description: Description of the diagnostics operation. -+ :vartype description: str -+ :ivar created_date_time: The timestamp when the operation was created. -+ :vartype created_date_time: str -+ :ivar last_action_date_time: A timestamp for when the current state was entered. -+ :vartype last_action_date_time: str -+ :ivar status: Operation status. Known values are: "NotStarted", "Running", "Succeeded", and -+ "Failed". -+ :vartype status: Union[str, "OperationStatus"] -+ """ -+ -+ operationId: str -+ """The log collection id.""" -+ deviceList: Required[list["DeviceUpdateAgentId"]] -+ """Array of Device Update agent ids. Required.""" -+ description: str -+ """Description of the diagnostics operation.""" -+ createdDateTime: str -+ """The timestamp when the operation was created.""" -+ lastActionDateTime: str -+ """A timestamp for when the current state was entered.""" -+ status: Union[str, "OperationStatus"] -+ """Operation status. Known values are: \"NotStarted\", \"Running\", \"Succeeded\", and \"Failed\".""" -+ -+ -+class PatchBody(TypedDict, total=False): -+ """Device Class JSON Merge Patch request body. -+ -+ :ivar friendly_name: The device class friendly name. Friendly name can be 1-100 characters, -+ alphanumeric, dot, and dash. Required. -+ :vartype friendly_name: str -+ """ -+ -+ friendlyName: Required[str] -+ """The device class friendly name. Friendly name can be 1-100 characters, alphanumeric, dot, and -+ dash. Required.""" -+ -+ -+class UpdateId(TypedDict, total=False): -+ """Update identifier. -+ -+ :ivar provider: Update provider. Required. -+ :vartype provider: str -+ :ivar name: Update name. Required. -+ :vartype name: str -+ :ivar version: Update version. Required. -+ :vartype version: str -+ """ -+ -+ provider: Required[str] -+ """Update provider. Required.""" -+ name: Required[str] -+ """Update name. Required.""" -+ version: Required[str] -+ """Update version. Required.""" -+ -+ -+class UpdateInfo(TypedDict, total=False): -+ """Update information. -+ -+ :ivar update_id: Update identifier. Required. -+ :vartype update_id: "UpdateId" -+ :ivar description: Update description. -+ :vartype description: str -+ :ivar friendly_name: Friendly update name. -+ :vartype friendly_name: str -+ """ -+ -+ updateId: Required["UpdateId"] -+ """Update identifier. Required.""" -+ description: str -+ """Update description.""" -+ friendlyName: str -+ """Friendly update name.""" -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml -index a77c2ee731..211c5f15dd 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml -@@ -1,19 +1,23 @@ -+# -------------------------------------------------------------------------- -+# Copyright (c) Microsoft Corporation. All rights reserved. -+# Licensed under the MIT License. See License.txt in the project root for license information. -+# Code generated by Microsoft (R) Python Code Generator. -+# Changes may cause incorrect behavior and will be lost if the code is regenerated. -+# -------------------------------------------------------------------------- -+ - [build-system] --requires = [ -- "setuptools>=77.0.3", -- "wheel", --] -+requires = ["setuptools>=77.0.3", "wheel"] - build-backend = "setuptools.build_meta" - - [project] - name = "azure-iot-deviceupdate" - authors = [ -- { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, -+ { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, - ] - description = "Microsoft Corporation Azure Iot Deviceupdate Client Library for Python" - license = "MIT" - classifiers = [ -- "Development Status :: 5 - Production/Stable", -+ "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", -@@ -24,32 +28,23 @@ classifiers = [ - "Programming Language :: Python :: 3.14", - ] - requires-python = ">=3.10" --keywords = [ -- "azure", -- "azure sdk", --] -+keywords = ["azure", "azure sdk"] -+ - dependencies = [ - "isodate>=0.6.1", - "azure-core>=1.37.0", - "typing-extensions>=4.6.0", - ] - dynamic = [ -- "version", -- "readme", -+"version", "readme" - ] - - [project.urls] - repository = "https://github.com/Azure/azure-sdk-for-python" - --[tool.setuptools.dynamic.version] --attr = "azure.iot.deviceupdate._version.VERSION" -- --[tool.setuptools.dynamic.readme] --file = [ -- "README.md", -- "CHANGELOG.md", --] --content-type = "text/markdown" -+[tool.setuptools.dynamic] -+version = {attr = "azure.iot.deviceupdate._version.VERSION"} -+readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"} - - [tool.setuptools.packages.find] - exclude = [ -@@ -63,9 +58,7 @@ exclude = [ - ] - - [tool.setuptools.package-data] --pytyped = [ -- "py.typed", --] -+pytyped = ["py.typed"] - - [tool.azure-sdk-build] - pyright = false -diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml -index dfe6b1560e..f8595069c1 100644 ---- a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml -+++ b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml -@@ -1,4 +1,4 @@ - directory: specification/deviceupdate/data-plane/duiothub --commit: 292231b1131ff9fd070377372a0647c6ac7a6ce2 -+commit: 67ffbb6bee462e36bcdd3b93cffca6942c3a35f7 - repo: Azure/azure-rest-api-specs - additionalDirectories: From 5de898114eb94e614ad306f50c9c3384b389dc14 Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Fri, 31 Jul 2026 15:31:09 -0400 Subject: [PATCH 07/11] update change log --- sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md index 2498daf3ab91..324a3004a108 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md @@ -5,6 +5,7 @@ ### Features Added - Regenerated the client library from the TypeSpec specification for the Device Update for IoT Hub `2026-06-01` GA API version. +- Added support for configuring TLS-secured update payload downloads through the `downloadSecurity` property when creating or updating a deployment. ### Breaking Changes From b98d9e125f4e4f415342fa87ac7ca53d62651ff9 Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Fri, 31 Jul 2026 16:06:41 -0400 Subject: [PATCH 08/11] Fix deviceupdate stable release classifier --- sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml index 211c5f15ddab..c7e0d3d7e0ff 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml @@ -17,7 +17,7 @@ authors = [ description = "Microsoft Corporation Azure Iot Deviceupdate Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", From 06069fed158cf020d951fdc9d44da239f6ca703f Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Sun, 2 Aug 2026 15:25:24 -0400 Subject: [PATCH 09/11] fix breaking change and sample --- .../azure-iot-deviceupdate/CHANGELOG.md | 7 -- .../azure/iot/deviceupdate/_patch.py | 42 ++++++++- .../azure/iot/deviceupdate/aio/_patch.py | 42 ++++++++- .../iot/deviceupdate/aio/operations/_patch.py | 88 ++++++++++++++++++- .../iot/deviceupdate/operations/_patch.py | 86 +++++++++++++++++- .../DeployUpdate/sample_deploy_update.py | 5 +- 6 files changed, 257 insertions(+), 13 deletions(-) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md index 324a3004a108..5e78bea3cab9 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md @@ -7,13 +7,6 @@ - Regenerated the client library from the TypeSpec specification for the Device Update for IoT Hub `2026-06-01` GA API version. - Added support for configuring TLS-secured update payload downloads through the `downloadSecurity` property when creating or updating a deployment. -### Breaking Changes - -- Changed the positional parameter order of `DeviceUpdateClient` from `endpoint, instance_id, credential` to `endpoint, credential, instance_id` for both synchronous and asynchronous clients. -- Replaced the `if_none_match` keyword parameter with `etag` and `match_condition` in `get_update`, `get_file`, and `get_operation_status` for both synchronous and asynchronous clients. -- Raised the minimum supported Python version from 3.6 to 3.10. -- Raised the minimum supported `azure-core` version from 1.24.0 to 1.37.0. - ## 1.0.0 (2022-09-09) ### Features Added diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py index 87676c65a8f0..2485462aff3e 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py @@ -8,8 +8,48 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any, List, Optional, TYPE_CHECKING -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level +from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated + +if TYPE_CHECKING: + from azure.core.credentials import TokenCredential + + +class DeviceUpdateClient(DeviceUpdateClientGenerated): + """Device Update for IoT Hub client. + + This override preserves the constructor parameter order shipped in 1.0.0 + (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client + orders the hoisted ``instance_id`` after ``credential``; restoring the original + order here avoids a breaking change for existing callers. + + :param endpoint: The Device Update for IoT Hub account endpoint. Required. + :type endpoint: str + :param instance_id: The Device Update for IoT Hub account instance identifier. Required. + :type instance_id: str + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". + Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + endpoint: str, + instance_id: str, + credential: "TokenCredential", + *, + api_version: Optional[str] = None, + **kwargs: Any, + ) -> None: + if api_version is not None: + kwargs["api_version"] = api_version + super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) + + +__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py index 87676c65a8f0..73feb5caa775 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py @@ -8,8 +8,48 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any, List, Optional, TYPE_CHECKING -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level +from ._client import DeviceUpdateClient as DeviceUpdateClientGenerated + +if TYPE_CHECKING: + from azure.core.credentials_async import AsyncTokenCredential + + +class DeviceUpdateClient(DeviceUpdateClientGenerated): + """Device Update for IoT Hub async client. + + This override preserves the constructor parameter order shipped in 1.0.0 + (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client + orders the hoisted ``instance_id`` after ``credential``; restoring the original + order here avoids a breaking change for existing callers. + + :param endpoint: The Device Update for IoT Hub account endpoint. Required. + :type endpoint: str + :param instance_id: The Device Update for IoT Hub account instance identifier. Required. + :type instance_id: str + :param credential: Credential used to authenticate requests to the service. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: The API version to use for this operation. Default value is "2026-06-01". + Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + endpoint: str, + instance_id: str, + credential: "AsyncTokenCredential", + *, + api_version: Optional[str] = None, + **kwargs: Any, + ) -> None: + if api_version is not None: + kwargs["api_version"] = api_version + super().__init__(endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs) + + +__all__: List[str] = ["DeviceUpdateClient"] # Add all objects you want publicly available at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py index 87676c65a8f0..0cc01201197f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/operations/_patch.py @@ -8,8 +8,94 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any, List, Optional -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level +from azure.core import MatchConditions + +from ._operations import ( + DeviceManagementOperations as DeviceManagementOperationsGenerated, + DeviceUpdateOperations as DeviceUpdateOperationsGenerated, +) + + +def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: + """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw + ``If-None-Match`` header value as-is (the generated client instead exposes the + ``etag`` / ``match_condition`` pattern). + + :param kwargs: The keyword arguments forwarded to the generated operation. + :type kwargs: any + :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. + :type if_none_match: str or None + """ + if if_none_match is not None: + headers = kwargs.setdefault("headers", {}) + headers.setdefault("If-None-Match", if_none_match) + + +class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): + async def get_update( + self, + provider: str, + name: str, + version: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return await super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) + + async def get_file( + self, + provider: str, + name: str, + version: str, + file_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return await super().get_file( + provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs + ) + + async def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) + + +class DeviceManagementOperations(DeviceManagementOperationsGenerated): + async def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return await super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) + + +__all__: List[str] = [ + "DeviceUpdateOperations", + "DeviceManagementOperations", +] # Add all objects you want publicly available at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py index 87676c65a8f0..dd6b7c08adf4 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/operations/_patch.py @@ -8,8 +8,92 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ +from typing import Any, List, Optional -__all__: list[str] = [] # Add all objects you want publicly available to users at this package level +from azure.core import MatchConditions + +from ._operations import ( + DeviceManagementOperations as DeviceManagementOperationsGenerated, + DeviceUpdateOperations as DeviceUpdateOperationsGenerated, +) + + +def _apply_if_none_match(kwargs: Any, if_none_match: Optional[str]) -> None: + """Restore the 1.0.0 ``if_none_match`` behavior by sending the raw + ``If-None-Match`` header value as-is (the generated client instead exposes the + ``etag`` / ``match_condition`` pattern). + + :param kwargs: The keyword arguments forwarded to the generated operation. + :type kwargs: any + :param if_none_match: The raw ``If-None-Match`` header value, or ``None``. + :type if_none_match: str or None + """ + if if_none_match is not None: + headers = kwargs.setdefault("headers", {}) + headers.setdefault("If-None-Match", if_none_match) + + +class DeviceUpdateOperations(DeviceUpdateOperationsGenerated): + def get_update( + self, + provider: str, + name: str, + version: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return super().get_update(provider, name, version, etag=etag, match_condition=match_condition, **kwargs) + + def get_file( + self, + provider: str, + name: str, + version: str, + file_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return super().get_file(provider, name, version, file_id, etag=etag, match_condition=match_condition, **kwargs) + + def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) + + +class DeviceManagementOperations(DeviceManagementOperationsGenerated): + def get_operation_status( + self, + operation_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + if_none_match: Optional[str] = None, + **kwargs: Any, + ): + _apply_if_none_match(kwargs, if_none_match) + return super().get_operation_status(operation_id, etag=etag, match_condition=match_condition, **kwargs) + + +__all__: List[str] = [ + "DeviceUpdateOperations", + "DeviceManagementOperations", +] # Add all objects you want publicly available at this package level def patch_sdk(): diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/samples/DeployUpdate/sample_deploy_update.py b/sdk/deviceupdate/azure-iot-deviceupdate/samples/DeployUpdate/sample_deploy_update.py index ba22af90782c..c9b4ee7c6ddd 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/samples/DeployUpdate/sample_deploy_update.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/samples/DeployUpdate/sample_deploy_update.py @@ -3,7 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -import json import os import uuid from datetime import datetime, timezone @@ -40,7 +39,9 @@ deployment = { "deploymentId": deployment_id, "startDateTime": str(datetime.now(timezone.utc)), - "updateId": {"provider": update_provider, "name": update_name, "version": update_version}, + "update": { + "updateId": {"provider": update_provider, "name": update_name, "version": update_version}, + }, "groupId": group, } From e8004e626c98a0695763609b03d1e19335736ee8 Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Sun, 2 Aug 2026 15:31:57 -0400 Subject: [PATCH 10/11] fix api md unmatch --- .../azure-iot-deviceupdate/api.md | 58 +++++++++---------- .../azure-iot-deviceupdate/api.metadata.yml | 2 +- .../azure-iot-deviceupdate/pyproject.toml | 1 + 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.md b/sdk/deviceupdate/azure-iot-deviceupdate/api.md index 2c374c860c33..227b8d115ff3 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.md @@ -1,18 +1,15 @@ ```py namespace azure.iot.deviceupdate - class azure.iot.deviceupdate.DeviceUpdateClient: implements ContextManager - device_management: DeviceManagementOperations - device_update: DeviceUpdateOperations + class azure.iot.deviceupdate.DeviceUpdateClient(DeviceUpdateClientGenerated): implements ContextManager def __init__( self, endpoint: str, - credential: TokenCredential, instance_id: str, + credential: TokenCredential, *, - api_version: str = ..., - polling_interval: Optional[int] = ..., + api_version: Optional[str] = ..., **kwargs: Any ) -> None: ... @@ -29,18 +26,15 @@ namespace azure.iot.deviceupdate namespace azure.iot.deviceupdate.aio - class azure.iot.deviceupdate.aio.DeviceUpdateClient: implements AsyncContextManager - device_management: DeviceManagementOperations - device_update: DeviceUpdateOperations + class azure.iot.deviceupdate.aio.DeviceUpdateClient(DeviceUpdateClientGenerated): implements AsyncContextManager def __init__( self, endpoint: str, - credential: AsyncTokenCredential, instance_id: str, + credential: AsyncTokenCredential, *, - api_version: str = ..., - polling_interval: Optional[int] = ..., + api_version: Optional[str] = ..., **kwargs: Any ) -> None: ... @@ -57,7 +51,7 @@ namespace azure.iot.deviceupdate.aio namespace azure.iot.deviceupdate.aio.operations - class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations: + class azure.iot.deviceupdate.aio.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): def __init__( self, @@ -234,15 +228,15 @@ namespace azure.iot.deviceupdate.aio.operations **kwargs: Any ) -> JSON: ... - @distributed_trace_async async def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... @distributed_trace_async async def get_update_compliance(self, **kwargs: Any) -> JSON: ... @@ -410,7 +404,7 @@ namespace azure.iot.deviceupdate.aio.operations ) -> JSON: ... - class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations: + class azure.iot.deviceupdate.aio.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): def __init__( self, @@ -445,7 +439,6 @@ namespace azure.iot.deviceupdate.aio.operations **kwargs: Any ) -> AsyncLROPoller[None]: ... - @distributed_trace_async async def get_file( self, provider: str, @@ -454,21 +447,21 @@ namespace azure.iot.deviceupdate.aio.operations file_id: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... - @distributed_trace_async async def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... - @distributed_trace_async async def get_update( self, provider: str, @@ -476,9 +469,10 @@ namespace azure.iot.deviceupdate.aio.operations version: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... @distributed_trace def list_files( @@ -530,7 +524,7 @@ namespace azure.iot.deviceupdate.aio.operations namespace azure.iot.deviceupdate.operations - class azure.iot.deviceupdate.operations.DeviceManagementOperations: + class azure.iot.deviceupdate.operations.DeviceManagementOperations(DeviceManagementOperationsGenerated): def __init__( self, @@ -707,15 +701,15 @@ namespace azure.iot.deviceupdate.operations **kwargs: Any ) -> JSON: ... - @distributed_trace def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... @distributed_trace def get_update_compliance(self, **kwargs: Any) -> JSON: ... @@ -883,7 +877,7 @@ namespace azure.iot.deviceupdate.operations ) -> JSON: ... - class azure.iot.deviceupdate.operations.DeviceUpdateOperations: + class azure.iot.deviceupdate.operations.DeviceUpdateOperations(DeviceUpdateOperationsGenerated): def __init__( self, @@ -918,7 +912,6 @@ namespace azure.iot.deviceupdate.operations **kwargs: Any ) -> LROPoller[None]: ... - @distributed_trace def get_file( self, provider: str, @@ -927,21 +920,21 @@ namespace azure.iot.deviceupdate.operations file_id: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... - @distributed_trace def get_operation_status( self, operation_id: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... - @distributed_trace def get_update( self, provider: str, @@ -949,9 +942,10 @@ namespace azure.iot.deviceupdate.operations version: str, *, etag: Optional[str] = ..., + if_none_match: Optional[str] = ..., match_condition: Optional[MatchConditions] = ..., **kwargs: Any - ) -> JSON: ... + ): ... @distributed_trace def list_files( diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml index d0148e9dd6e7..96165cf086f4 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/api.metadata.yml @@ -1,3 +1,3 @@ -apiMdSha256: 882e4cfe462148f114ff430c460be79a27b5b447a7107cfd0bab4b508020f70f +apiMdSha256: 0905ddcc120a0db6530091f763b3112f45ba75499f1a68ebbaa09550bcbab38a parserVersion: 0.3.30 pythonVersion: 3.13.14 diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml index c7e0d3d7e0ff..bcc5b2711b2d 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/pyproject.toml @@ -62,6 +62,7 @@ pytyped = ["py.typed"] [tool.azure-sdk-build] pyright = false +verifytypes = false ci_enabled = false [tool.azure-sdk-conda] From 0f363bb9a9ad033b16cacd2663acc692b5c08ea0 Mon Sep 17 00:00:00 2001 From: Austin Wu Date: Sun, 2 Aug 2026 16:19:07 -0400 Subject: [PATCH 11/11] update comment --- .../azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py | 5 ++++- .../azure/iot/deviceupdate/aio/_patch.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py index 2485462aff3e..2d216784b243 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_patch.py @@ -17,7 +17,10 @@ class DeviceUpdateClient(DeviceUpdateClientGenerated): - """Device Update for IoT Hub client. + """Client for the Azure Device Update for IoT Hub service. + + Device Update enables customers to publish updates to the cloud and deploy them to groups of + IoT devices managed and provisioned in IoT Hub. This override preserves the constructor parameter order shipped in 1.0.0 (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py index 73feb5caa775..ab22e1d56c33 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py +++ b/sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/aio/_patch.py @@ -17,7 +17,10 @@ class DeviceUpdateClient(DeviceUpdateClientGenerated): - """Device Update for IoT Hub async client. + """Async client for the Azure Device Update for IoT Hub service. + + Device Update enables customers to publish updates to the cloud and deploy them to groups of + IoT devices managed and provisioned in IoT Hub. This override preserves the constructor parameter order shipped in 1.0.0 (``endpoint``, ``instance_id``, ``credential``). The TypeSpec-generated client