@azure-rest/iot-device-update 1.0.0-alpha.20220330.1 → 1.0.0-alpha.20220331.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/deviceUpdate.ts","../src/paginateHelper.ts","../src/pollingHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DeviceManagementCollectLogsParameters,\n DeviceManagementCreateOrUpdateDeploymentParameters,\n DeviceManagementCreateOrUpdateGroupParameters,\n DeviceManagementDeleteDeploymentParameters,\n DeviceManagementDeleteGroupParameters,\n DeviceManagementGetDeploymentParameters,\n DeviceManagementGetDeploymentStatusParameters,\n DeviceManagementGetDeviceClassParameters,\n DeviceManagementGetDeviceModuleParameters,\n DeviceManagementGetDeviceParameters,\n DeviceManagementGetDeviceTagParameters,\n DeviceManagementGetGroupParameters,\n DeviceManagementGetGroupUpdateComplianceParameters,\n DeviceManagementGetLogCollectionOperationDetailedStatusParameters,\n DeviceManagementGetLogCollectionOperationParameters,\n DeviceManagementGetOperationParameters,\n DeviceManagementGetUpdateComplianceParameters,\n DeviceManagementImportDevicesParameters,\n DeviceManagementListBestUpdatesForGroupParameters,\n DeviceManagementListDeploymentDevicesParameters,\n DeviceManagementListDeploymentsForGroupParameters,\n DeviceManagementListDeviceClassesParameters,\n DeviceManagementListDeviceTagsParameters,\n DeviceManagementListDevicesParameters,\n DeviceManagementListGroupsParameters,\n DeviceManagementListInstallableUpdatesForDeviceClassParameters,\n DeviceManagementListLogCollectionOperationsParameters,\n DeviceManagementListOperationsParameters,\n DeviceManagementRetryDeploymentParameters,\n DeviceManagementStopDeploymentParameters,\n DeviceUpdateDeleteUpdateParameters,\n DeviceUpdateGetFileParameters,\n DeviceUpdateGetOperationParameters,\n DeviceUpdateGetUpdateParameters,\n DeviceUpdateImportUpdateParameters,\n DeviceUpdateListFilesParameters,\n DeviceUpdateListNamesParameters,\n DeviceUpdateListOperationsParameters,\n DeviceUpdateListProvidersParameters,\n DeviceUpdateListUpdatesParameters,\n DeviceUpdateListVersionsParameters,\n} from \"./parameters\";\nimport {\n DeviceManagementCollectLogs201Response,\n DeviceManagementCollectLogsdefaultResponse,\n DeviceManagementCreateOrUpdateDeployment200Response,\n DeviceManagementCreateOrUpdateDeploymentdefaultResponse,\n DeviceManagementCreateOrUpdateGroup200Response,\n DeviceManagementCreateOrUpdateGroupdefaultResponse,\n DeviceManagementDeleteDeployment204Response,\n DeviceManagementDeleteDeploymentdefaultResponse,\n DeviceManagementDeleteGroup204Response,\n DeviceManagementDeleteGroupdefaultResponse,\n DeviceManagementGetDeployment200Response,\n DeviceManagementGetDeploymentStatus200Response,\n DeviceManagementGetDeploymentStatusdefaultResponse,\n DeviceManagementGetDeploymentdefaultResponse,\n DeviceManagementGetDevice200Response,\n DeviceManagementGetDeviceClass200Response,\n DeviceManagementGetDeviceClassdefaultResponse,\n DeviceManagementGetDeviceModule200Response,\n DeviceManagementGetDeviceModuledefaultResponse,\n DeviceManagementGetDeviceTag200Response,\n DeviceManagementGetDeviceTagdefaultResponse,\n DeviceManagementGetDevicedefaultResponse,\n DeviceManagementGetGroup200Response,\n DeviceManagementGetGroupUpdateCompliance200Response,\n DeviceManagementGetGroupUpdateCompliancedefaultResponse,\n DeviceManagementGetGroupdefaultResponse,\n DeviceManagementGetLogCollectionOperation200Response,\n DeviceManagementGetLogCollectionOperationDetailedStatus200Response,\n DeviceManagementGetLogCollectionOperationDetailedStatusdefaultResponse,\n DeviceManagementGetLogCollectionOperationdefaultResponse,\n DeviceManagementGetOperation200Response,\n DeviceManagementGetOperation304Response,\n DeviceManagementGetOperationdefaultResponse,\n DeviceManagementGetUpdateCompliance200Response,\n DeviceManagementGetUpdateCompliancedefaultResponse,\n DeviceManagementImportDevices202Response,\n DeviceManagementImportDevicesdefaultResponse,\n DeviceManagementListBestUpdatesForGroup200Response,\n DeviceManagementListBestUpdatesForGroupdefaultResponse,\n DeviceManagementListDeploymentDevices200Response,\n DeviceManagementListDeploymentDevicesdefaultResponse,\n DeviceManagementListDeploymentsForGroup200Response,\n DeviceManagementListDeploymentsForGroupdefaultResponse,\n DeviceManagementListDeviceClasses200Response,\n DeviceManagementListDeviceClassesdefaultResponse,\n DeviceManagementListDeviceTags200Response,\n DeviceManagementListDeviceTagsdefaultResponse,\n DeviceManagementListDevices200Response,\n DeviceManagementListDevicesdefaultResponse,\n DeviceManagementListGroups200Response,\n DeviceManagementListGroupsdefaultResponse,\n DeviceManagementListInstallableUpdatesForDeviceClass200Response,\n DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse,\n DeviceManagementListLogCollectionOperations200Response,\n DeviceManagementListLogCollectionOperationsdefaultResponse,\n DeviceManagementListOperations200Response,\n DeviceManagementListOperationsdefaultResponse,\n DeviceManagementRetryDeployment200Response,\n DeviceManagementRetryDeploymentdefaultResponse,\n DeviceManagementStopDeployment200Response,\n DeviceManagementStopDeploymentdefaultResponse,\n DeviceUpdateDeleteUpdate202Response,\n DeviceUpdateDeleteUpdatedefaultResponse,\n DeviceUpdateGetFile200Response,\n DeviceUpdateGetFile304Response,\n DeviceUpdateGetFiledefaultResponse,\n DeviceUpdateGetOperation200Response,\n DeviceUpdateGetOperation304Response,\n DeviceUpdateGetOperationdefaultResponse,\n DeviceUpdateGetUpdate200Response,\n DeviceUpdateGetUpdate304Response,\n DeviceUpdateGetUpdatedefaultResponse,\n DeviceUpdateImportUpdate202Response,\n DeviceUpdateImportUpdatedefaultResponse,\n DeviceUpdateListFiles200Response,\n DeviceUpdateListFilesdefaultResponse,\n DeviceUpdateListNames200Response,\n DeviceUpdateListNamesdefaultResponse,\n DeviceUpdateListOperations200Response,\n DeviceUpdateListOperationsdefaultResponse,\n DeviceUpdateListProviders200Response,\n DeviceUpdateListProvidersdefaultResponse,\n DeviceUpdateListUpdates200Response,\n DeviceUpdateListUpdatesdefaultResponse,\n DeviceUpdateListVersions200Response,\n DeviceUpdateListVersionsdefaultResponse,\n} from \"./responses\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface DeviceUpdateImportUpdate {\n /** Import new update version. */\n post(\n options: DeviceUpdateImportUpdateParameters\n ): Promise<DeviceUpdateImportUpdate202Response | DeviceUpdateImportUpdatedefaultResponse>;\n /** Get a list of all updates that have been imported to Device Update for IoT Hub. */\n get(\n options?: DeviceUpdateListUpdatesParameters\n ): Promise<DeviceUpdateListUpdates200Response | DeviceUpdateListUpdatesdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetUpdate {\n /** Get a specific update version. */\n get(\n options?: DeviceUpdateGetUpdateParameters\n ): Promise<\n | DeviceUpdateGetUpdate200Response\n | DeviceUpdateGetUpdate304Response\n | DeviceUpdateGetUpdatedefaultResponse\n >;\n /** Delete a specific update version. */\n delete(\n options?: DeviceUpdateDeleteUpdateParameters\n ): Promise<DeviceUpdateDeleteUpdate202Response | DeviceUpdateDeleteUpdatedefaultResponse>;\n}\n\nexport interface DeviceUpdateListProviders {\n /** Get a list of all update providers that have been imported to Device Update for IoT Hub. */\n get(\n options?: DeviceUpdateListProvidersParameters\n ): Promise<DeviceUpdateListProviders200Response | DeviceUpdateListProvidersdefaultResponse>;\n}\n\nexport interface DeviceUpdateListNames {\n /** Get a list of all update names that match the specified provider. */\n get(\n options?: DeviceUpdateListNamesParameters\n ): Promise<DeviceUpdateListNames200Response | DeviceUpdateListNamesdefaultResponse>;\n}\n\nexport interface DeviceUpdateListVersions {\n /** Get a list of all update versions that match the specified provider and name. */\n get(\n options?: DeviceUpdateListVersionsParameters\n ): Promise<DeviceUpdateListVersions200Response | DeviceUpdateListVersionsdefaultResponse>;\n}\n\nexport interface DeviceUpdateListFiles {\n /** Get a list of all update file identifiers for the specified version. */\n get(\n options?: DeviceUpdateListFilesParameters\n ): Promise<DeviceUpdateListFiles200Response | DeviceUpdateListFilesdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetFile {\n /** Get a specific update file from the version. */\n get(\n options?: DeviceUpdateGetFileParameters\n ): Promise<\n | DeviceUpdateGetFile200Response\n | DeviceUpdateGetFile304Response\n | DeviceUpdateGetFiledefaultResponse\n >;\n}\n\nexport interface DeviceUpdateListOperations {\n /** 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. */\n get(\n options?: DeviceUpdateListOperationsParameters\n ): Promise<DeviceUpdateListOperations200Response | DeviceUpdateListOperationsdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetOperation {\n /** Retrieve operation status. */\n get(\n options?: DeviceUpdateGetOperationParameters\n ): Promise<\n | DeviceUpdateGetOperation200Response\n | DeviceUpdateGetOperation304Response\n | DeviceUpdateGetOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeviceClasses {\n /** Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDeviceClassesParameters\n ): Promise<\n DeviceManagementListDeviceClasses200Response | DeviceManagementListDeviceClassesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeviceClass {\n /** Gets the properties of a device class. */\n get(\n options?: DeviceManagementGetDeviceClassParameters\n ): Promise<\n DeviceManagementGetDeviceClass200Response | DeviceManagementGetDeviceClassdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListInstallableUpdatesForDeviceClass {\n /** Gets a list of installable updates for a device class. */\n get(\n options?: DeviceManagementListInstallableUpdatesForDeviceClassParameters\n ): Promise<\n | DeviceManagementListInstallableUpdatesForDeviceClass200Response\n | DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDevices {\n /** Gets a list of devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDevicesParameters\n ): Promise<DeviceManagementListDevices200Response | DeviceManagementListDevicesdefaultResponse>;\n /** Import existing devices from IoT Hub. */\n post(\n options: DeviceManagementImportDevicesParameters\n ): Promise<\n DeviceManagementImportDevices202Response | DeviceManagementImportDevicesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDevice {\n /** Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementGetDeviceParameters\n ): Promise<DeviceManagementGetDevice200Response | DeviceManagementGetDevicedefaultResponse>;\n}\n\nexport interface DeviceManagementGetDeviceModule {\n /** Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementGetDeviceModuleParameters\n ): Promise<\n DeviceManagementGetDeviceModule200Response | DeviceManagementGetDeviceModuledefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetUpdateCompliance {\n /** Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates. */\n get(\n options?: DeviceManagementGetUpdateComplianceParameters\n ): Promise<\n | DeviceManagementGetUpdateCompliance200Response\n | DeviceManagementGetUpdateCompliancedefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeviceTags {\n /** Gets a list of available group device tags for all devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDeviceTagsParameters\n ): Promise<\n DeviceManagementListDeviceTags200Response | DeviceManagementListDeviceTagsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeviceTag {\n /** Gets a count of how many devices have a device tag. */\n get(\n options?: DeviceManagementGetDeviceTagParameters\n ): Promise<DeviceManagementGetDeviceTag200Response | DeviceManagementGetDeviceTagdefaultResponse>;\n}\n\nexport interface DeviceManagementListGroups {\n /** Gets a list of all device groups. */\n get(\n options?: DeviceManagementListGroupsParameters\n ): Promise<DeviceManagementListGroups200Response | DeviceManagementListGroupsdefaultResponse>;\n}\n\nexport interface DeviceManagementGetGroup {\n /** Gets the properties of a group. */\n get(\n options?: DeviceManagementGetGroupParameters\n ): Promise<DeviceManagementGetGroup200Response | DeviceManagementGetGroupdefaultResponse>;\n /** Create or update a device group. */\n put(\n options: DeviceManagementCreateOrUpdateGroupParameters\n ): Promise<\n | DeviceManagementCreateOrUpdateGroup200Response\n | DeviceManagementCreateOrUpdateGroupdefaultResponse\n >;\n /** Deletes a device group. */\n delete(\n options?: DeviceManagementDeleteGroupParameters\n ): Promise<DeviceManagementDeleteGroup204Response | DeviceManagementDeleteGroupdefaultResponse>;\n}\n\nexport interface DeviceManagementGetGroupUpdateCompliance {\n /** Get 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. */\n get(\n options?: DeviceManagementGetGroupUpdateComplianceParameters\n ): Promise<\n | DeviceManagementGetGroupUpdateCompliance200Response\n | DeviceManagementGetGroupUpdateCompliancedefaultResponse\n >;\n}\n\nexport interface DeviceManagementListBestUpdatesForGroup {\n /** Get the best available updates for a group and a count of how many devices need each update. */\n get(\n options?: DeviceManagementListBestUpdatesForGroupParameters\n ): Promise<\n | DeviceManagementListBestUpdatesForGroup200Response\n | DeviceManagementListBestUpdatesForGroupdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeploymentsForGroup {\n /** Gets a list of deployments for a group. */\n get(\n options?: DeviceManagementListDeploymentsForGroupParameters\n ): Promise<\n | DeviceManagementListDeploymentsForGroup200Response\n | DeviceManagementListDeploymentsForGroupdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeployment {\n /** Gets the properties of a deployment. */\n get(\n options?: DeviceManagementGetDeploymentParameters\n ): Promise<\n DeviceManagementGetDeployment200Response | DeviceManagementGetDeploymentdefaultResponse\n >;\n /** Creates or updates a deployment. */\n put(\n options: DeviceManagementCreateOrUpdateDeploymentParameters\n ): Promise<\n | DeviceManagementCreateOrUpdateDeployment200Response\n | DeviceManagementCreateOrUpdateDeploymentdefaultResponse\n >;\n /** Deletes a deployment. */\n delete(\n options?: DeviceManagementDeleteDeploymentParameters\n ): Promise<\n DeviceManagementDeleteDeployment204Response | DeviceManagementDeleteDeploymentdefaultResponse\n >;\n /** Stops a deployment. */\n post(\n options: DeviceManagementStopDeploymentParameters | DeviceManagementRetryDeploymentParameters\n ):\n | Promise<\n DeviceManagementStopDeployment200Response | DeviceManagementStopDeploymentdefaultResponse\n >\n | Promise<\n DeviceManagementRetryDeployment200Response | DeviceManagementRetryDeploymentdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeploymentStatus {\n /** Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. */\n get(\n options?: DeviceManagementGetDeploymentStatusParameters\n ): Promise<\n | DeviceManagementGetDeploymentStatus200Response\n | DeviceManagementGetDeploymentStatusdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeploymentDevices {\n /** Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. */\n get(\n options?: DeviceManagementListDeploymentDevicesParameters\n ): Promise<\n | DeviceManagementListDeploymentDevices200Response\n | DeviceManagementListDeploymentDevicesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetOperation {\n /** Retrieve operation status. */\n get(\n options?: DeviceManagementGetOperationParameters\n ): Promise<\n | DeviceManagementGetOperation200Response\n | DeviceManagementGetOperation304Response\n | DeviceManagementGetOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListOperations {\n /** Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. */\n get(\n options?: DeviceManagementListOperationsParameters\n ): Promise<\n DeviceManagementListOperations200Response | DeviceManagementListOperationsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementCollectLogs {\n /** Start the device diagnostics log collection operation on specified devices. */\n put(\n options: DeviceManagementCollectLogsParameters\n ): Promise<DeviceManagementCollectLogs201Response | DeviceManagementCollectLogsdefaultResponse>;\n /** Get the device diagnostics log collection operation */\n get(\n options?: DeviceManagementGetLogCollectionOperationParameters\n ): Promise<\n | DeviceManagementGetLogCollectionOperation200Response\n | DeviceManagementGetLogCollectionOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListLogCollectionOperations {\n /** Get all device diagnostics log collection operations */\n get(\n options?: DeviceManagementListLogCollectionOperationsParameters\n ): Promise<\n | DeviceManagementListLogCollectionOperations200Response\n | DeviceManagementListLogCollectionOperationsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetLogCollectionOperationDetailedStatus {\n /** Get device diagnostics log collection operation with detailed status */\n get(\n options?: DeviceManagementGetLogCollectionOperationDetailedStatusParameters\n ): Promise<\n | DeviceManagementGetLogCollectionOperationDetailedStatus200Response\n | DeviceManagementGetLogCollectionOperationDetailedStatusdefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates' has methods for the following verbs: post, get */\n (path: \"/deviceupdate/{instanceId}/updates\", instanceId: string): DeviceUpdateImportUpdate;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}' has methods for the following verbs: get, delete */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}\",\n instanceId: string,\n provider: string,\n name: string,\n version: string\n ): DeviceUpdateGetUpdate;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers\",\n instanceId: string\n ): DeviceUpdateListProviders;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names\",\n instanceId: string,\n provider: string\n ): DeviceUpdateListNames;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions\",\n instanceId: string,\n provider: string,\n name: string\n ): DeviceUpdateListVersions;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}/files' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files\",\n instanceId: string,\n provider: string,\n name: string,\n version: string\n ): DeviceUpdateListFiles;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}/files/\\{fileId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}\",\n instanceId: string,\n provider: string,\n name: string,\n version: string,\n fileId: string\n ): DeviceUpdateGetFile;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/operations' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/operations\",\n instanceId: string\n ): DeviceUpdateListOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/operations/\\{operationId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/operations/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceUpdateGetOperation;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses\",\n instanceId: string\n ): DeviceManagementListDeviceClasses;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses/\\{deviceClassId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses/{deviceClassId}\",\n instanceId: string,\n deviceClassId: string\n ): DeviceManagementGetDeviceClass;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses/\\{deviceClassId\\}/installableupdates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses/{deviceClassId}/installableupdates\",\n instanceId: string,\n deviceClassId: string\n ): DeviceManagementListInstallableUpdatesForDeviceClass;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices' has methods for the following verbs: get, post */\n (\n path: \"/deviceupdate/{instanceId}/management/devices\",\n instanceId: string\n ): DeviceManagementListDevices;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices/\\{deviceId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devices/{deviceId}\",\n instanceId: string,\n deviceId: string\n ): DeviceManagementGetDevice;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices/\\{deviceId\\}/modules/\\{moduleId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}\",\n instanceId: string,\n deviceId: string,\n moduleId: string\n ): DeviceManagementGetDeviceModule;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/updatecompliance' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/updatecompliance\",\n instanceId: string\n ): DeviceManagementGetUpdateCompliance;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devicetags' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devicetags\",\n instanceId: string\n ): DeviceManagementListDeviceTags;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devicetags/\\{tagName\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devicetags/{tagName}\",\n instanceId: string,\n tagName: string\n ): DeviceManagementGetDeviceTag;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups\",\n instanceId: string\n ): DeviceManagementListGroups;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}' has methods for the following verbs: get, put, delete */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}\",\n instanceId: string,\n groupId: string\n ): DeviceManagementGetGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/updateCompliance' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/updateCompliance\",\n instanceId: string,\n groupId: string\n ): DeviceManagementGetGroupUpdateCompliance;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/bestUpdates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/bestUpdates\",\n instanceId: string,\n groupId: string\n ): DeviceManagementListBestUpdatesForGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments\",\n instanceId: string,\n groupId: string\n ): DeviceManagementListDeploymentsForGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}' has methods for the following verbs: get, put, delete, post */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementGetDeployment;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}/status' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementGetDeploymentStatus;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}/devicestates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/devicestates\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementListDeploymentDevices;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/operations/\\{operationId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/operations/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceManagementGetOperation;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/operations' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/operations\",\n instanceId: string\n ): DeviceManagementListOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections/\\{operationId\\}' has methods for the following verbs: put, get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceManagementCollectLogs;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections\",\n instanceId: string\n ): DeviceManagementListLogCollectionOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections/\\{operationId\\}/detailedStatus' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus\",\n instanceId: string,\n operationId: string\n ): DeviceManagementGetLogCollectionOperationDetailedStatus;\n}\n\nexport type DeviceUpdateRestClient = Client & {\n path: Routes;\n};\n\nexport default function DeviceUpdate(\n endpoint: string,\n credentials: TokenCredential,\n options: ClientOptions = {}\n): DeviceUpdateRestClient {\n const baseUrl = options.baseUrl ?? `https://${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2021-06-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://api.adu.microsoft.com/.default\"],\n },\n };\n\n return getClient(baseUrl, credentials, options) as DeviceUpdateRestClient;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { PagedAsyncIterableIterator, PagedResult, getPagedAsyncIterator } from \"@azure/core-paging\";\nimport { Client, PathUncheckedResponse, createRestError } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollOperationState,\n PollerLike,\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\n return getLroResponse(response as TResult);\n },\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport DeviceUpdate from \"./deviceUpdate\";\n\nexport * from \"./deviceUpdate\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default DeviceUpdate;\n"],"names":["getClient","getPagedAsyncIterator","createRestError","LroEngine"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","sources":["../src/deviceUpdate.ts","../src/paginateHelper.ts","../src/pollingHelper.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n DeviceManagementCollectLogsParameters,\n DeviceManagementCreateOrUpdateDeploymentParameters,\n DeviceManagementCreateOrUpdateGroupParameters,\n DeviceManagementDeleteDeploymentParameters,\n DeviceManagementDeleteGroupParameters,\n DeviceManagementGetDeploymentParameters,\n DeviceManagementGetDeploymentStatusParameters,\n DeviceManagementGetDeviceClassParameters,\n DeviceManagementGetDeviceModuleParameters,\n DeviceManagementGetDeviceParameters,\n DeviceManagementGetDeviceTagParameters,\n DeviceManagementGetGroupParameters,\n DeviceManagementGetGroupUpdateComplianceParameters,\n DeviceManagementGetLogCollectionOperationDetailedStatusParameters,\n DeviceManagementGetLogCollectionOperationParameters,\n DeviceManagementGetOperationParameters,\n DeviceManagementGetUpdateComplianceParameters,\n DeviceManagementImportDevicesParameters,\n DeviceManagementListBestUpdatesForGroupParameters,\n DeviceManagementListDeploymentDevicesParameters,\n DeviceManagementListDeploymentsForGroupParameters,\n DeviceManagementListDeviceClassesParameters,\n DeviceManagementListDeviceTagsParameters,\n DeviceManagementListDevicesParameters,\n DeviceManagementListGroupsParameters,\n DeviceManagementListInstallableUpdatesForDeviceClassParameters,\n DeviceManagementListLogCollectionOperationsParameters,\n DeviceManagementListOperationsParameters,\n DeviceManagementRetryDeploymentParameters,\n DeviceManagementStopDeploymentParameters,\n DeviceUpdateDeleteUpdateParameters,\n DeviceUpdateGetFileParameters,\n DeviceUpdateGetOperationParameters,\n DeviceUpdateGetUpdateParameters,\n DeviceUpdateImportUpdateParameters,\n DeviceUpdateListFilesParameters,\n DeviceUpdateListNamesParameters,\n DeviceUpdateListOperationsParameters,\n DeviceUpdateListProvidersParameters,\n DeviceUpdateListUpdatesParameters,\n DeviceUpdateListVersionsParameters,\n} from \"./parameters\";\nimport {\n DeviceManagementCollectLogs201Response,\n DeviceManagementCollectLogsdefaultResponse,\n DeviceManagementCreateOrUpdateDeployment200Response,\n DeviceManagementCreateOrUpdateDeploymentdefaultResponse,\n DeviceManagementCreateOrUpdateGroup200Response,\n DeviceManagementCreateOrUpdateGroupdefaultResponse,\n DeviceManagementDeleteDeployment204Response,\n DeviceManagementDeleteDeploymentdefaultResponse,\n DeviceManagementDeleteGroup204Response,\n DeviceManagementDeleteGroupdefaultResponse,\n DeviceManagementGetDeployment200Response,\n DeviceManagementGetDeploymentStatus200Response,\n DeviceManagementGetDeploymentStatusdefaultResponse,\n DeviceManagementGetDeploymentdefaultResponse,\n DeviceManagementGetDevice200Response,\n DeviceManagementGetDeviceClass200Response,\n DeviceManagementGetDeviceClassdefaultResponse,\n DeviceManagementGetDeviceModule200Response,\n DeviceManagementGetDeviceModuledefaultResponse,\n DeviceManagementGetDeviceTag200Response,\n DeviceManagementGetDeviceTagdefaultResponse,\n DeviceManagementGetDevicedefaultResponse,\n DeviceManagementGetGroup200Response,\n DeviceManagementGetGroupUpdateCompliance200Response,\n DeviceManagementGetGroupUpdateCompliancedefaultResponse,\n DeviceManagementGetGroupdefaultResponse,\n DeviceManagementGetLogCollectionOperation200Response,\n DeviceManagementGetLogCollectionOperationDetailedStatus200Response,\n DeviceManagementGetLogCollectionOperationDetailedStatusdefaultResponse,\n DeviceManagementGetLogCollectionOperationdefaultResponse,\n DeviceManagementGetOperation200Response,\n DeviceManagementGetOperation304Response,\n DeviceManagementGetOperationdefaultResponse,\n DeviceManagementGetUpdateCompliance200Response,\n DeviceManagementGetUpdateCompliancedefaultResponse,\n DeviceManagementImportDevices202Response,\n DeviceManagementImportDevicesdefaultResponse,\n DeviceManagementListBestUpdatesForGroup200Response,\n DeviceManagementListBestUpdatesForGroupdefaultResponse,\n DeviceManagementListDeploymentDevices200Response,\n DeviceManagementListDeploymentDevicesdefaultResponse,\n DeviceManagementListDeploymentsForGroup200Response,\n DeviceManagementListDeploymentsForGroupdefaultResponse,\n DeviceManagementListDeviceClasses200Response,\n DeviceManagementListDeviceClassesdefaultResponse,\n DeviceManagementListDeviceTags200Response,\n DeviceManagementListDeviceTagsdefaultResponse,\n DeviceManagementListDevices200Response,\n DeviceManagementListDevicesdefaultResponse,\n DeviceManagementListGroups200Response,\n DeviceManagementListGroupsdefaultResponse,\n DeviceManagementListInstallableUpdatesForDeviceClass200Response,\n DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse,\n DeviceManagementListLogCollectionOperations200Response,\n DeviceManagementListLogCollectionOperationsdefaultResponse,\n DeviceManagementListOperations200Response,\n DeviceManagementListOperationsdefaultResponse,\n DeviceManagementRetryDeployment200Response,\n DeviceManagementRetryDeploymentdefaultResponse,\n DeviceManagementStopDeployment200Response,\n DeviceManagementStopDeploymentdefaultResponse,\n DeviceUpdateDeleteUpdate202Response,\n DeviceUpdateDeleteUpdatedefaultResponse,\n DeviceUpdateGetFile200Response,\n DeviceUpdateGetFile304Response,\n DeviceUpdateGetFiledefaultResponse,\n DeviceUpdateGetOperation200Response,\n DeviceUpdateGetOperation304Response,\n DeviceUpdateGetOperationdefaultResponse,\n DeviceUpdateGetUpdate200Response,\n DeviceUpdateGetUpdate304Response,\n DeviceUpdateGetUpdatedefaultResponse,\n DeviceUpdateImportUpdate202Response,\n DeviceUpdateImportUpdatedefaultResponse,\n DeviceUpdateListFiles200Response,\n DeviceUpdateListFilesdefaultResponse,\n DeviceUpdateListNames200Response,\n DeviceUpdateListNamesdefaultResponse,\n DeviceUpdateListOperations200Response,\n DeviceUpdateListOperationsdefaultResponse,\n DeviceUpdateListProviders200Response,\n DeviceUpdateListProvidersdefaultResponse,\n DeviceUpdateListUpdates200Response,\n DeviceUpdateListUpdatesdefaultResponse,\n DeviceUpdateListVersions200Response,\n DeviceUpdateListVersionsdefaultResponse,\n} from \"./responses\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface DeviceUpdateImportUpdate {\n /** Import new update version. */\n post(\n options: DeviceUpdateImportUpdateParameters\n ): Promise<DeviceUpdateImportUpdate202Response | DeviceUpdateImportUpdatedefaultResponse>;\n /** Get a list of all updates that have been imported to Device Update for IoT Hub. */\n get(\n options?: DeviceUpdateListUpdatesParameters\n ): Promise<DeviceUpdateListUpdates200Response | DeviceUpdateListUpdatesdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetUpdate {\n /** Get a specific update version. */\n get(\n options?: DeviceUpdateGetUpdateParameters\n ): Promise<\n | DeviceUpdateGetUpdate200Response\n | DeviceUpdateGetUpdate304Response\n | DeviceUpdateGetUpdatedefaultResponse\n >;\n /** Delete a specific update version. */\n delete(\n options?: DeviceUpdateDeleteUpdateParameters\n ): Promise<DeviceUpdateDeleteUpdate202Response | DeviceUpdateDeleteUpdatedefaultResponse>;\n}\n\nexport interface DeviceUpdateListProviders {\n /** Get a list of all update providers that have been imported to Device Update for IoT Hub. */\n get(\n options?: DeviceUpdateListProvidersParameters\n ): Promise<DeviceUpdateListProviders200Response | DeviceUpdateListProvidersdefaultResponse>;\n}\n\nexport interface DeviceUpdateListNames {\n /** Get a list of all update names that match the specified provider. */\n get(\n options?: DeviceUpdateListNamesParameters\n ): Promise<DeviceUpdateListNames200Response | DeviceUpdateListNamesdefaultResponse>;\n}\n\nexport interface DeviceUpdateListVersions {\n /** Get a list of all update versions that match the specified provider and name. */\n get(\n options?: DeviceUpdateListVersionsParameters\n ): Promise<DeviceUpdateListVersions200Response | DeviceUpdateListVersionsdefaultResponse>;\n}\n\nexport interface DeviceUpdateListFiles {\n /** Get a list of all update file identifiers for the specified version. */\n get(\n options?: DeviceUpdateListFilesParameters\n ): Promise<DeviceUpdateListFiles200Response | DeviceUpdateListFilesdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetFile {\n /** Get a specific update file from the version. */\n get(\n options?: DeviceUpdateGetFileParameters\n ): Promise<\n | DeviceUpdateGetFile200Response\n | DeviceUpdateGetFile304Response\n | DeviceUpdateGetFiledefaultResponse\n >;\n}\n\nexport interface DeviceUpdateListOperations {\n /** 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. */\n get(\n options?: DeviceUpdateListOperationsParameters\n ): Promise<DeviceUpdateListOperations200Response | DeviceUpdateListOperationsdefaultResponse>;\n}\n\nexport interface DeviceUpdateGetOperation {\n /** Retrieve operation status. */\n get(\n options?: DeviceUpdateGetOperationParameters\n ): Promise<\n | DeviceUpdateGetOperation200Response\n | DeviceUpdateGetOperation304Response\n | DeviceUpdateGetOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeviceClasses {\n /** Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDeviceClassesParameters\n ): Promise<\n DeviceManagementListDeviceClasses200Response | DeviceManagementListDeviceClassesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeviceClass {\n /** Gets the properties of a device class. */\n get(\n options?: DeviceManagementGetDeviceClassParameters\n ): Promise<\n DeviceManagementGetDeviceClass200Response | DeviceManagementGetDeviceClassdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListInstallableUpdatesForDeviceClass {\n /** Gets a list of installable updates for a device class. */\n get(\n options?: DeviceManagementListInstallableUpdatesForDeviceClassParameters\n ): Promise<\n | DeviceManagementListInstallableUpdatesForDeviceClass200Response\n | DeviceManagementListInstallableUpdatesForDeviceClassdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDevices {\n /** Gets a list of devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDevicesParameters\n ): Promise<DeviceManagementListDevices200Response | DeviceManagementListDevicesdefaultResponse>;\n /** Import existing devices from IoT Hub. */\n post(\n options: DeviceManagementImportDevicesParameters\n ): Promise<\n DeviceManagementImportDevices202Response | DeviceManagementImportDevicesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDevice {\n /** Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementGetDeviceParameters\n ): Promise<DeviceManagementGetDevice200Response | DeviceManagementGetDevicedefaultResponse>;\n}\n\nexport interface DeviceManagementGetDeviceModule {\n /** Gets the device module properties and latest deployment status for a device module connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementGetDeviceModuleParameters\n ): Promise<\n DeviceManagementGetDeviceModule200Response | DeviceManagementGetDeviceModuledefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetUpdateCompliance {\n /** Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress receiving new updates. */\n get(\n options?: DeviceManagementGetUpdateComplianceParameters\n ): Promise<\n | DeviceManagementGetUpdateCompliance200Response\n | DeviceManagementGetUpdateCompliancedefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeviceTags {\n /** Gets a list of available group device tags for all devices connected to Device Update for IoT Hub. */\n get(\n options?: DeviceManagementListDeviceTagsParameters\n ): Promise<\n DeviceManagementListDeviceTags200Response | DeviceManagementListDeviceTagsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeviceTag {\n /** Gets a count of how many devices have a device tag. */\n get(\n options?: DeviceManagementGetDeviceTagParameters\n ): Promise<DeviceManagementGetDeviceTag200Response | DeviceManagementGetDeviceTagdefaultResponse>;\n}\n\nexport interface DeviceManagementListGroups {\n /** Gets a list of all device groups. */\n get(\n options?: DeviceManagementListGroupsParameters\n ): Promise<DeviceManagementListGroups200Response | DeviceManagementListGroupsdefaultResponse>;\n}\n\nexport interface DeviceManagementGetGroup {\n /** Gets the properties of a group. */\n get(\n options?: DeviceManagementGetGroupParameters\n ): Promise<DeviceManagementGetGroup200Response | DeviceManagementGetGroupdefaultResponse>;\n /** Create or update a device group. */\n put(\n options: DeviceManagementCreateOrUpdateGroupParameters\n ): Promise<\n | DeviceManagementCreateOrUpdateGroup200Response\n | DeviceManagementCreateOrUpdateGroupdefaultResponse\n >;\n /** Deletes a device group. */\n delete(\n options?: DeviceManagementDeleteGroupParameters\n ): Promise<DeviceManagementDeleteGroup204Response | DeviceManagementDeleteGroupdefaultResponse>;\n}\n\nexport interface DeviceManagementGetGroupUpdateCompliance {\n /** Get 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. */\n get(\n options?: DeviceManagementGetGroupUpdateComplianceParameters\n ): Promise<\n | DeviceManagementGetGroupUpdateCompliance200Response\n | DeviceManagementGetGroupUpdateCompliancedefaultResponse\n >;\n}\n\nexport interface DeviceManagementListBestUpdatesForGroup {\n /** Get the best available updates for a group and a count of how many devices need each update. */\n get(\n options?: DeviceManagementListBestUpdatesForGroupParameters\n ): Promise<\n | DeviceManagementListBestUpdatesForGroup200Response\n | DeviceManagementListBestUpdatesForGroupdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeploymentsForGroup {\n /** Gets a list of deployments for a group. */\n get(\n options?: DeviceManagementListDeploymentsForGroupParameters\n ): Promise<\n | DeviceManagementListDeploymentsForGroup200Response\n | DeviceManagementListDeploymentsForGroupdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeployment {\n /** Gets the properties of a deployment. */\n get(\n options?: DeviceManagementGetDeploymentParameters\n ): Promise<\n DeviceManagementGetDeployment200Response | DeviceManagementGetDeploymentdefaultResponse\n >;\n /** Creates or updates a deployment. */\n put(\n options: DeviceManagementCreateOrUpdateDeploymentParameters\n ): Promise<\n | DeviceManagementCreateOrUpdateDeployment200Response\n | DeviceManagementCreateOrUpdateDeploymentdefaultResponse\n >;\n /** Deletes a deployment. */\n delete(\n options?: DeviceManagementDeleteDeploymentParameters\n ): Promise<\n DeviceManagementDeleteDeployment204Response | DeviceManagementDeleteDeploymentdefaultResponse\n >;\n /** Stops a deployment. */\n post(\n options: DeviceManagementStopDeploymentParameters | DeviceManagementRetryDeploymentParameters\n ):\n | Promise<\n DeviceManagementStopDeployment200Response | DeviceManagementStopDeploymentdefaultResponse\n >\n | Promise<\n DeviceManagementRetryDeployment200Response | DeviceManagementRetryDeploymentdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetDeploymentStatus {\n /** Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, completed, or failed. */\n get(\n options?: DeviceManagementGetDeploymentStatusParameters\n ): Promise<\n | DeviceManagementGetDeploymentStatus200Response\n | DeviceManagementGetDeploymentStatusdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListDeploymentDevices {\n /** Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. */\n get(\n options?: DeviceManagementListDeploymentDevicesParameters\n ): Promise<\n | DeviceManagementListDeploymentDevices200Response\n | DeviceManagementListDeploymentDevicesdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetOperation {\n /** Retrieve operation status. */\n get(\n options?: DeviceManagementGetOperationParameters\n ): Promise<\n | DeviceManagementGetOperation200Response\n | DeviceManagementGetOperation304Response\n | DeviceManagementGetOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListOperations {\n /** Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. */\n get(\n options?: DeviceManagementListOperationsParameters\n ): Promise<\n DeviceManagementListOperations200Response | DeviceManagementListOperationsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementCollectLogs {\n /** Start the device diagnostics log collection operation on specified devices. */\n put(\n options: DeviceManagementCollectLogsParameters\n ): Promise<DeviceManagementCollectLogs201Response | DeviceManagementCollectLogsdefaultResponse>;\n /** Get the device diagnostics log collection operation */\n get(\n options?: DeviceManagementGetLogCollectionOperationParameters\n ): Promise<\n | DeviceManagementGetLogCollectionOperation200Response\n | DeviceManagementGetLogCollectionOperationdefaultResponse\n >;\n}\n\nexport interface DeviceManagementListLogCollectionOperations {\n /** Get all device diagnostics log collection operations */\n get(\n options?: DeviceManagementListLogCollectionOperationsParameters\n ): Promise<\n | DeviceManagementListLogCollectionOperations200Response\n | DeviceManagementListLogCollectionOperationsdefaultResponse\n >;\n}\n\nexport interface DeviceManagementGetLogCollectionOperationDetailedStatus {\n /** Get device diagnostics log collection operation with detailed status */\n get(\n options?: DeviceManagementGetLogCollectionOperationDetailedStatusParameters\n ): Promise<\n | DeviceManagementGetLogCollectionOperationDetailedStatus200Response\n | DeviceManagementGetLogCollectionOperationDetailedStatusdefaultResponse\n >;\n}\n\nexport interface Routes {\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates' has methods for the following verbs: post, get */\n (path: \"/deviceupdate/{instanceId}/updates\", instanceId: string): DeviceUpdateImportUpdate;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}' has methods for the following verbs: get, delete */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}\",\n instanceId: string,\n provider: string,\n name: string,\n version: string\n ): DeviceUpdateGetUpdate;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers\",\n instanceId: string\n ): DeviceUpdateListProviders;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names\",\n instanceId: string,\n provider: string\n ): DeviceUpdateListNames;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions\",\n instanceId: string,\n provider: string,\n name: string\n ): DeviceUpdateListVersions;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}/files' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files\",\n instanceId: string,\n provider: string,\n name: string,\n version: string\n ): DeviceUpdateListFiles;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/providers/\\{provider\\}/names/\\{name\\}/versions/\\{version\\}/files/\\{fileId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}\",\n instanceId: string,\n provider: string,\n name: string,\n version: string,\n fileId: string\n ): DeviceUpdateGetFile;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/operations' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/operations\",\n instanceId: string\n ): DeviceUpdateListOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/updates/operations/\\{operationId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/updates/operations/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceUpdateGetOperation;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses\",\n instanceId: string\n ): DeviceManagementListDeviceClasses;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses/\\{deviceClassId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses/{deviceClassId}\",\n instanceId: string,\n deviceClassId: string\n ): DeviceManagementGetDeviceClass;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceclasses/\\{deviceClassId\\}/installableupdates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceclasses/{deviceClassId}/installableupdates\",\n instanceId: string,\n deviceClassId: string\n ): DeviceManagementListInstallableUpdatesForDeviceClass;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices' has methods for the following verbs: get, post */\n (\n path: \"/deviceupdate/{instanceId}/management/devices\",\n instanceId: string\n ): DeviceManagementListDevices;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices/\\{deviceId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devices/{deviceId}\",\n instanceId: string,\n deviceId: string\n ): DeviceManagementGetDevice;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devices/\\{deviceId\\}/modules/\\{moduleId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}\",\n instanceId: string,\n deviceId: string,\n moduleId: string\n ): DeviceManagementGetDeviceModule;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/updatecompliance' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/updatecompliance\",\n instanceId: string\n ): DeviceManagementGetUpdateCompliance;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devicetags' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devicetags\",\n instanceId: string\n ): DeviceManagementListDeviceTags;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/devicetags/\\{tagName\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/devicetags/{tagName}\",\n instanceId: string,\n tagName: string\n ): DeviceManagementGetDeviceTag;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups\",\n instanceId: string\n ): DeviceManagementListGroups;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}' has methods for the following verbs: get, put, delete */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}\",\n instanceId: string,\n groupId: string\n ): DeviceManagementGetGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/updateCompliance' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/updateCompliance\",\n instanceId: string,\n groupId: string\n ): DeviceManagementGetGroupUpdateCompliance;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/bestUpdates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/bestUpdates\",\n instanceId: string,\n groupId: string\n ): DeviceManagementListBestUpdatesForGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments\",\n instanceId: string,\n groupId: string\n ): DeviceManagementListDeploymentsForGroup;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}' has methods for the following verbs: get, put, delete, post */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementGetDeployment;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}/status' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementGetDeploymentStatus;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/groups/\\{groupId\\}/deployments/\\{deploymentId\\}/devicestates' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/devicestates\",\n instanceId: string,\n groupId: string,\n deploymentId: string\n ): DeviceManagementListDeploymentDevices;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/operations/\\{operationId\\}' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/operations/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceManagementGetOperation;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/operations' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/operations\",\n instanceId: string\n ): DeviceManagementListOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections/\\{operationId\\}' has methods for the following verbs: put, get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}\",\n instanceId: string,\n operationId: string\n ): DeviceManagementCollectLogs;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections\",\n instanceId: string\n ): DeviceManagementListLogCollectionOperations;\n /** Resource for '/deviceupdate/\\{instanceId\\}/management/deviceDiagnostics/logCollections/\\{operationId\\}/detailedStatus' has methods for the following verbs: get */\n (\n path: \"/deviceupdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus\",\n instanceId: string,\n operationId: string\n ): DeviceManagementGetLogCollectionOperationDetailedStatus;\n}\n\nexport type DeviceUpdateRestClient = Client & {\n path: Routes;\n};\n\nexport default function DeviceUpdate(\n endpoint: string,\n credentials: TokenCredential,\n options: ClientOptions = {}\n): DeviceUpdateRestClient {\n const baseUrl = options.baseUrl ?? `https://${endpoint}`;\n options.apiVersion = options.apiVersion ?? \"2021-06-01-preview\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://api.adu.microsoft.com/.default\"],\n },\n };\n\n return getClient(baseUrl, credentials, options) as DeviceUpdateRestClient;\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { PagedAsyncIterableIterator, PagedResult, getPagedAsyncIterator } from \"@azure/core-paging\";\nimport { Client, PathUncheckedResponse, createRestError } from \"@azure-rest/core-client\";\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (\n pageLink: string,\n maxPageSize?: number\n) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {}\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response\n );\n }\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollOperationState,\n PollerLike,\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\n return getLroResponse(response as TResult);\n },\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport DeviceUpdate from \"./deviceUpdate\";\n\nexport * from \"./deviceUpdate\";\nexport * from \"./parameters\";\nexport * from \"./responses\";\nexport * from \"./models\";\nexport * from \"./outputModels\";\nexport * from \"./paginateHelper\";\nexport * from \"./pollingHelper\";\n\nexport default DeviceUpdate;\n"],"names":["getClient","getPagedAsyncIterator","createRestError","LroEngine"],"mappings":"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"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sdk-type": "client",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "Device Update for IoT Hub is an Azure service that enables customers to publish update 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.",
6
- "version": "1.0.0-alpha.20220330.1",
6
+ "version": "1.0.0-alpha.20220331.1",
7
7
  "keywords": [
8
8
  "node",
9
9
  "azure",