diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md index e429c29ed32c..d1f52e69fb50 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md @@ -1,14 +1,23 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2026-06-15) + +This release is the first preview of the rewritten Device Update for IoT Hub client library generated from +TypeSpec. It targets API version `2026-06-01`. ### Features Added -### Breaking Changes +- Added `DeviceManagementClient` (and `DeviceManagementAsyncClient`) for device, group, deployment and + diagnostics operations, plus `DeviceManagementClientBuilder`. +- `DeviceUpdateClient` (and `DeviceUpdateAsyncClient`) now expose strongly-typed models in addition to the + existing low-level `BinaryData` / `RequestOptions` overloads. -### Bugs Fixed +### Breaking Changes -### Other Changes +- `DeviceUpdateClientBuilder.buildClient()` and `buildAsyncClient()` were removed. Use + `buildDeviceUpdateClient()` / `buildDeviceUpdateAsyncClient()` for the update catalog, and the new + `DeviceManagementClientBuilder` (or `DeviceUpdateClientBuilder.buildDeviceManagementClient()` / + `buildDeviceManagementAsyncClient()`) for device management. ## 1.0.33 (2026-05-05) @@ -372,4 +381,4 @@ This is a new version of client SDK. Changes are: This is the initial release of Azure Device Update for IoT Hub library. For more information, please see the [README](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/deviceupdate/azure-iot-deviceupdate/README.md) and [samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/README.md). -This is a Public Preview version, so breaking changes are possible in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for Java GitHub repo](https://github.com/Azure/azure-sdk-for-java/issues). +This is a Public Preview version, so breaking changes are possible in subsequent releases as we improve the product. To provide feedback, please submit an issue in our [Azure SDK for Java GitHub repo](https://github.com/Azure/azure-sdk-for-java/issues). \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java index 6a0bd0204814..0ad7e10966ad 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate; @@ -12,23 +12,49 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.iot.deviceupdate.implementation.DeviceManagementsImpl; +import com.azure.iot.deviceupdate.implementation.JsonMergePatchHelper; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.DeploymentDeviceState; +import com.azure.iot.deviceupdate.models.DeploymentStatus; +import com.azure.iot.deviceupdate.models.Device; +import com.azure.iot.deviceupdate.models.DeviceClass; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroup; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices; +import com.azure.iot.deviceupdate.models.DeviceHealth; +import com.azure.iot.deviceupdate.models.DeviceOperation; +import com.azure.iot.deviceupdate.models.Group; +import com.azure.iot.deviceupdate.models.ImportType; +import com.azure.iot.deviceupdate.models.LogCollection; +import com.azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus; +import com.azure.iot.deviceupdate.models.PatchBody; +import com.azure.iot.deviceupdate.models.UpdateCompliance; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous DeviceUpdateClient type. */ -@ServiceClient(builder = DeviceManagementClientBuilder.class, isAsync = true) +/** + * Initializes a new instance of the asynchronous DeviceUpdateClient type. + */ +@ServiceClient(builder = DeviceUpdateClientBuilder.class, isAsync = true) public final class DeviceManagementAsyncClient { @Generated private final DeviceManagementsImpl serviceClient; /** * Initializes an instance of DeviceManagementAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -37,60 +63,56 @@ public final class DeviceManagementAsyncClient { } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on friendly name.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on + * friendly name.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             friendlyName: String (Optional)
-     *             deviceClassProperties (Required): {
-     *                 contractModel (Optional): {
-     *                     id: String (Required)
-     *                     name: String (Required)
-     *                 }
-     *                 compatProperties (Required): {
-     *                     String: String (Required)
-     *                 }
-     *             }
-     *             bestCompatibleUpdate (Optional): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
+     *     deviceClassId: String (Required)
+     *     friendlyName: String (Optional)
+     *     deviceClassProperties (Required): {
+     *         contractModel (Optional): {
+     *             id: String (Required)
+     *             name: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         compatProperties (Required): {
+     *             String: String (Required)
+     *         }
+     *     }
+     *     bestCompatibleUpdate (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 as paginated response with {@link PagedFlux}. + * @return 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 as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -100,10 +122,10 @@ public PagedFlux listDeviceClasses(RequestOptions requestOptions) { /** * Gets the properties of a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -126,8 +148,9 @@ public PagedFlux listDeviceClasses(RequestOptions requestOptions) {
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -144,18 +167,20 @@ public Mono> getDeviceClassWithResponse(String deviceClassI /** * Update device class details. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
-     *     friendlyName: String (Required)
+     *     friendlyName: String (Optional, Required on create)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -178,10 +203,12 @@ public Mono> getDeviceClassWithResponse(String deviceClassI
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. - * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching + * friendlyName. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -197,12 +224,14 @@ public Mono> updateDeviceClassWithResponse(String deviceCla } /** - * Deletes a device class. Device classes are created automatically when Device Update-enabled devices are connected - * to the hub but are not automatically cleaned up since they are referenced by DeviceClassSubgroups. If the user - * has deleted all DeviceClassSubgroups for a device class they can also delete the device class to remove the - * records from the system and to stop checking the compatibility of this device class with new updates. If a device - * is ever reconnected for this device class it will be re-created. - * + * Deletes a device class. Device classes are created automatically when Device + * Update-enabled devices are connected to the hub but are not automatically + * cleaned up since they are referenced by DeviceClassSubgroups. If the user has + * deleted all DeviceClassSubgroups for a device class they can also delete the + * device class to remove the records from the system and to stop checking the + * compatibility of this device class with new updates. If a device is ever + * reconnected for this device class it will be re-created. + * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -219,26 +248,22 @@ public Mono> deleteDeviceClassWithResponse(String deviceClassId, /** * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             updateId (Required): {
-     *                 provider: String (Required)
-     *                 name: String (Required)
-     *                 version: String (Required)
-     *             }
-     *             description: String (Optional)
-     *             friendlyName: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     friendlyName: String (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -256,60 +281,56 @@ public PagedFlux listInstallableUpdatesForDeviceClass(String deviceC /** * Gets a list of devices connected to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to query for devices with no deployment status (that have never been deployed to).
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on + * GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to).
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             deviceClassId: String (Required)
-     *             groupId: String (Optional)
-     *             lastAttemptedUpdate (Optional): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Optional)
+     *     lastAttemptedUpdate (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed) (Optional)
+     *     installedUpdate (Optional): (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean (Required)
+     *     lastDeploymentId: String (Optional)
+     *     lastInstallResult (Optional): {
+     *         resultCode: int (Required)
+     *         extendedResultCode: int (Required)
+     *         resultDetails: String (Optional)
+     *         stepResults (Optional): [
+     *              (Optional){
+     *                 update (Optional): (recursive schema, see update above)
      *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed) (Optional)
-     *             installedUpdate (Optional): (recursive schema, see installedUpdate above)
-     *             onLatestUpdate: boolean (Required)
-     *             lastDeploymentId: String (Optional)
-     *             lastInstallResult (Optional): {
      *                 resultCode: int (Required)
      *                 extendedResultCode: int (Required)
      *                 resultDetails: String (Optional)
-     *                 stepResults (Optional): [
-     *                      (Optional){
-     *                         update (Optional): (recursive schema, see update above)
-     *                         description: String (Optional)
-     *                         resultCode: int (Required)
-     *                         extendedResultCode: int (Required)
-     *                         resultDetails: String (Optional)
-     *                     }
-     *                 ]
      *             }
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         ]
+     *     }
+     * }
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -324,15 +345,16 @@ public PagedFlux listDevices(RequestOptions requestOptions) { } /** - * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header - * value to check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import existing devices from IoT Hub. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * String(Devices/Modules/All)
-     * }
- * + * } + *
+ * * @param importType The types of devices to import. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -348,11 +370,12 @@ public PollerFlux beginImportDevices(BinaryData importTy } /** - * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device properties and latest deployment status for a device connected
+     * to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -386,16 +409,17 @@ public PollerFlux beginImportDevices(BinaryData importTy
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub - * along with {@link Response} on successful completion of {@link Mono}. + * @return the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -404,12 +428,12 @@ public Mono> getDeviceWithResponse(String deviceId, Request } /** - * Gets the device module properties and latest deployment status for a device module connected to Device Update for - * IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device module properties and latest deployment status for a device
+     * module connected to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -443,8 +467,9 @@ public Mono> getDeviceWithResponse(String deviceId, Request
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param moduleId Device module identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -452,8 +477,9 @@ public Mono> getDeviceWithResponse(String deviceId, Request * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device module properties and latest deployment status for a device module connected to Device Update - * for IoT Hub along with {@link Response} on successful completion of {@link Mono}. + * @return the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -463,27 +489,29 @@ public Mono> getDeviceModuleWithResponse(String deviceId, S } /** - * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress - * receiving new updates. - * - *

Response Body Schema - * - *

{@code
+     * Gets the breakdown of how many devices are on their latest update, have new
+     * updates available, or are in progress receiving new updates.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the breakdown of how many devices are on their latest update, have new updates available, or are in - * progress receiving new updates along with {@link Response} on successful completion of {@link Mono}. + * @return the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates along with {@link Response} on successful completion + * of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -492,40 +520,37 @@ public Mono> getUpdateComplianceWithResponse(RequestOptions } /** - * Gets a list of all device groups. The $default group will always be returned first. - * - *

Query Parameters - * + * Gets a list of all device groups. The $default group will always be returned + * first. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, + * deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             groupType: String(IoTHubTag/DefaultNoTag) (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
-     *             subgroupsWithUpdatesInProgressCount: Integer (Optional)
-     *             subgroupsWithOnLatestUpdateCount: Integer (Optional)
-     *             deployments (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
+     *     groupId: String (Required)
+     *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
+     *     subgroupsWithUpdatesInProgressCount: Integer (Optional)
+     *     subgroupsWithOnLatestUpdateCount: Integer (Optional)
+     *     deployments (Optional): [
+     *         String (Optional)
      *     ]
-     *     nextLink: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -541,10 +566,10 @@ public PagedFlux listGroups(RequestOptions requestOptions) { /** * Gets the device group properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -557,8 +582,9 @@ public PagedFlux listGroups(RequestOptions requestOptions) {
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -574,12 +600,14 @@ public Mono> getGroupWithResponse(String groupId, RequestOp } /** - * Deletes a device group. This group is automatically created when a Device Update-enabled device is connected to - * the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned up but are - * retained for history purposes. Users can call this method to delete a group if they do not need to retain any of - * the history of the group and no longer need it. If a device is ever connected again for this group after the - * group was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device group. This group is automatically created when a Device + * Update-enabled device is connected to the hub and reports its properties. + * Groups, subgroups, and deployments are not automatically cleaned up but are + * retained for history purposes. Users can call this method to delete a group if + * they do not need to retain any of the history of the group and no longer need + * it. If a device is ever connected again for this group after the group was + * deleted it will be automatically re-created but there will be no history. + * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -595,29 +623,31 @@ public Mono> deleteGroupWithResponse(String groupId, RequestOptio } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link Response} on - * successful completion of {@link Mono}. + * @return 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 along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -627,40 +657,37 @@ public Mono> getUpdateComplianceForGroupWithResponse(String } /** - * Get the best available updates for a device group and a count of how many devices need each update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             deviceClassId: String (Required)
-     *             update (Required): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             deviceCount: int (Required)
+     *     groupId: String (Required)
+     *     deviceClassId: String (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     deviceCount: int (Required)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available updates for a device group and a count of how many devices need each update as - * paginated response with {@link PagedFlux}. + * @return the best available updates for a device group and a count of how many + * devices need each update as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -670,54 +697,49 @@ public PagedFlux listBestUpdatesForGroup(String groupId, RequestOpti /** * Gets a list of deployments for a device group. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deploymentId: String (Required)
-     *             startDateTime: OffsetDateTime (Required)
-     *             update (Required): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             groupId: String (Required)
-     *             deviceClassSubgroups (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             isCanceled: Boolean (Optional)
-     *             isRetried: Boolean (Optional)
-     *             rollbackPolicy (Optional): {
-     *                 update (Required): (recursive schema, see update above)
-     *                 failure (Required): {
-     *                     devicesFailedPercentage: int (Required)
-     *                     devicesFailedCount: int (Required)
-     *                 }
-     *             }
-     *             isCloudInitiatedRollback: Boolean (Optional)
+     *     deploymentId: String (Required)
+     *     startDateTime: OffsetDateTime (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     groupId: String (Required)
+     *     deviceClassSubgroups (Optional): [
+     *         String (Optional)
      *     ]
-     *     nextLink: String (Optional)
+     *     isCanceled: Boolean (Optional)
+     *     isRetried: Boolean (Optional)
+     *     rollbackPolicy (Optional): {
+     *         update (Required): (recursive schema, see update above)
+     *         failure (Required): {
+     *             devicesFailedPercentage: int (Required)
+     *             devicesFailedCount: int (Required)
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -734,10 +756,10 @@ public PagedFlux listDeploymentsForGroup(String groupId, RequestOpti /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -764,9 +786,11 @@ public PagedFlux listDeploymentsForGroup(String groupId, RequestOpti
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -785,10 +809,10 @@ public Mono> getDeploymentWithResponse(String groupId, Stri /** * Creates or updates a deployment. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -815,12 +839,15 @@ public Mono> getDeploymentWithResponse(String groupId, Stri
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -847,9 +874,11 @@ public Mono> getDeploymentWithResponse(String groupId, Stri
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param deployment The deployment properties. @@ -869,31 +898,12 @@ public Mono> createOrUpdateDeploymentWithResponse(String gr } /** - * Deletes a deployment. - * - * @param groupId Group identifier. - * @param deploymentId Deployment identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeploymentWithResponse(String groupId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.deleteDeploymentWithResponseAsync(groupId, deploymentId, requestOptions); - } - - /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled) (Required)
@@ -926,8 +936,9 @@ public Mono> deleteDeploymentWithResponse(String groupId, String
      *         }
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -935,8 +946,9 @@ public Mono> deleteDeploymentWithResponse(String groupId, String * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -946,36 +958,33 @@ public Mono> getDeploymentStatusWithResponse(String groupId } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2')
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can + * filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2')
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             groupId: String (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             deploymentId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -991,12 +1000,13 @@ public PagedFlux listDeviceClassSubgroupsForGroup(String groupId, Re } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -1004,8 +1014,9 @@ public PagedFlux listDeviceClassSubgroupsForGroup(String groupId, Re
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1023,12 +1034,15 @@ public Mono> getDeviceClassSubgroupWithResponse(String grou } /** - * Deletes a device class subgroup. This subgroup is automatically created when a Device Update-enabled device is - * connected to the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned - * up but are retained for history purposes. Users can call this method to delete a subgroup if they do not need to - * retain any of the history of the subgroup and no longer need it. If a device is ever connected again for this - * subgroup after the subgroup was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device class subgroup. This subgroup is automatically created when a + * Device Update-enabled device is connected to the hub and reports its + * properties. Groups, subgroups, and deployments are not automatically cleaned up + * but are retained for history purposes. Users can call this method to delete a + * subgroup if they do not need to retain any of the history of the subgroup and + * no longer need it. If a device is ever connected again for this subgroup after + * the subgroup was deleted it will be automatically re-created but there will be + * no history. + * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1046,20 +1060,22 @@ public Mono> deleteDeviceClassSubgroupWithResponse(String groupId } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1067,9 +1083,9 @@ public Mono> deleteDeviceClassSubgroupWithResponse(String groupId * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link Response} - * on successful completion of {@link Mono}. + * @return 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 along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1080,11 +1096,12 @@ public Mono> getDeviceClassSubgroupUpdateComplianceWithResp } /** - * Get the best available update for a device class subgroup and a count of how many devices need this update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available update for a device class subgroup and a count of how
+     * many devices need this update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -1099,8 +1116,9 @@ public Mono> getDeviceClassSubgroupUpdateComplianceWithResp
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1108,8 +1126,8 @@ public Mono> getDeviceClassSubgroupUpdateComplianceWithResp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available update for a device class subgroup and a count of how many devices need this update - * along with {@link Response} on successful completion of {@link Mono}. + * @return the best available update for a device class subgroup and a count of how + * many devices need this update along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1121,54 +1139,49 @@ public Mono> getBestUpdatesForDeviceClassSubgroupWithRespon /** * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deploymentId: String (Required)
-     *             startDateTime: OffsetDateTime (Required)
-     *             update (Required): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             groupId: String (Required)
-     *             deviceClassSubgroups (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             isCanceled: Boolean (Optional)
-     *             isRetried: Boolean (Optional)
-     *             rollbackPolicy (Optional): {
-     *                 update (Required): (recursive schema, see update above)
-     *                 failure (Required): {
-     *                     devicesFailedPercentage: int (Required)
-     *                     devicesFailedCount: int (Required)
-     *                 }
-     *             }
-     *             isCloudInitiatedRollback: Boolean (Optional)
+     *     deploymentId: String (Required)
+     *     startDateTime: OffsetDateTime (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     groupId: String (Required)
+     *     deviceClassSubgroups (Optional): [
+     *         String (Optional)
      *     ]
-     *     nextLink: String (Optional)
+     *     isCanceled: Boolean (Optional)
+     *     isRetried: Boolean (Optional)
+     *     rollbackPolicy (Optional): {
+     *         update (Required): (recursive schema, see update above)
+     *         failure (Required): {
+     *             devicesFailedPercentage: int (Required)
+     *             devicesFailedCount: int (Required)
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1187,10 +1200,10 @@ public PagedFlux listDeploymentsForDeviceClassSubgroup(String groupI /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1217,9 +1230,11 @@ public PagedFlux listDeploymentsForDeviceClassSubgroup(String groupI
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1238,33 +1253,12 @@ public Mono> getDeploymentForDeviceClassSubgroupWithRespons deploymentId, requestOptions); } - /** - * Deletes a device class subgroup deployment. - * - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.deleteDeploymentForDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, - deploymentId, requestOptions); - } - /** * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1291,9 +1285,11 @@ public Mono> deleteDeploymentForDeviceClassSubgroupWithResponse(S
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1313,10 +1309,10 @@ public Mono> stopDeploymentWithResponse(String groupId, Str /** * Retries a deployment with failed devices. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1343,9 +1339,11 @@ public Mono> stopDeploymentWithResponse(String groupId, Str
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1365,12 +1363,12 @@ public Mono> retryDeploymentWithResponse(String groupId, St } /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -1396,8 +1394,9 @@ public Mono> retryDeploymentWithResponse(String groupId, St
      *     devicesCompletedSucceededCount: Integer (Optional)
      *     devicesCanceledCount: Integer (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1406,8 +1405,9 @@ public Mono> retryDeploymentWithResponse(String groupId, St * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1418,35 +1418,31 @@ public Mono> getDeviceClassSubgroupDeploymentStatusWithResp } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. - * - *

Query Parameters - * + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can + * filter on + * deviceId and moduleId and/or deviceState.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             retryCount: int (Required)
-     *             movedOnToNewDeployment: boolean (Required)
-     *             deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     retryCount: int (Required)
+     *     movedOnToNewDeployment: boolean (Required)
+     *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1467,20 +1463,19 @@ public PagedFlux listDeviceStatesForDeviceClassSubgroupDeployment(St /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -1504,8 +1499,9 @@ public PagedFlux listDeviceStatesForDeviceClassSubgroupDeployment(St
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1522,52 +1518,51 @@ public Mono> getOperationStatusWithResponse(String operatio } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. - * - *

Query Parameters - * + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             operationId: String (Required)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             error (Optional): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Optional)
-     *                     errorDetail: String (Optional)
-     *                     innerError (Optional): (recursive schema, see innerError above)
-     *                 }
-     *                 occurredDateTime: OffsetDateTime (Optional)
-     *             }
-     *             traceId: String (Optional)
-     *             lastActionDateTime: OffsetDateTime (Required)
-     *             createdDateTime: OffsetDateTime (Required)
-     *             etag: String (Optional)
+     *     operationId: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Required)
+     *             message: String (Optional)
+     *             errorDetail: String (Optional)
+     *             innerError (Optional): (recursive schema, see innerError above)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * + * occurredDateTime: OffsetDateTime (Optional) + * } + * traceId: String (Optional) + * lastActionDateTime: OffsetDateTime (Required) + * createdDateTime: OffsetDateTime (Required) + * etag: String (Optional) + * } + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1583,10 +1578,10 @@ public PagedFlux listOperationStatuses(RequestOptions requestOptions /** * Start the device diagnostics log collection on specified devices. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -1600,11 +1595,13 @@ public PagedFlux listOperationStatuses(RequestOptions requestOptions
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -1618,8 +1615,9 @@ public PagedFlux listOperationStatuses(RequestOptions requestOptions
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param logCollection The log collection properties. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1638,10 +1636,10 @@ public Mono> startLogCollectionWithResponse(String logColle /** * Get the device diagnostics log collection. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -1655,16 +1653,17 @@ public Mono> startLogCollectionWithResponse(String logColle
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device diagnostics log collection along with {@link Response} on successful completion of {@link - * Mono}. + * @return the device diagnostics log collection along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1675,30 +1674,26 @@ public Mono> getLogCollectionWithResponse(String logCollect /** * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
      *          (Required){
-     *             operationId: String (Optional)
-     *             deviceList (Required): [
-     *                  (Required){
-     *                     deviceId: String (Required)
-     *                     moduleId: String (Optional)
-     *                 }
-     *             ]
-     *             description: String (Optional)
-     *             createdDateTime: String (Optional)
-     *             lastActionDateTime: String (Optional)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Optional)
+     *             deviceId: String (Required)
+     *             moduleId: String (Optional)
      *         }
      *     ]
-     *     nextLink: String (Optional)
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1714,10 +1709,10 @@ public PagedFlux listLogCollections(RequestOptions requestOptions) { /** * Get log collection with detailed status. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     createdDateTime: String (Optional)
@@ -1735,8 +1730,9 @@ public PagedFlux listLogCollections(RequestOptions requestOptions) {
      *     ]
      *     description: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1754,31 +1750,27 @@ public Mono> getLogCollectionDetailedStatusWithResponse(Str /** * Get list of device health. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     state: String(healthy/unhealthy) (Required)
+     *     digitalTwinModelId: String (Optional)
+     *     healthChecks (Required): [
      *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             state: String(healthy/unhealthy) (Required)
-     *             digitalTwinModelId: String (Optional)
-     *             healthChecks (Required): [
-     *                  (Required){
-     *                     name: String (Optional)
-     *                     result: String(success/userError) (Optional)
-     *                 }
-     *             ]
+     *             name: String (Optional)
+     *             result: String(success/userError) (Optional)
      *         }
      *     ]
-     *     nextLink: String (Optional)
      * }
-     * }
- * - * @param filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * } + *
+ * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1791,4 +1783,1428 @@ public Mono> getLogCollectionDetailedStatusWithResponse(Str public PagedFlux listHealthOfDevices(String filter, RequestOptions requestOptions) { return this.serviceClient.listHealthOfDevicesAsync(filter, requestOptions); } + + /** + * Deletes a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeploymentWithResponse(String groupId, String deploymentId, + RequestOptions requestOptions) { + return this.serviceClient.deleteDeploymentWithResponseAsync(groupId, deploymentId, requestOptions); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, + String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.deleteDeploymentForDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, + deploymentId, requestOptions); + } + + /** + * 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. + * + * @param filter Restricts the set of device classes returned. You can filter on friendly name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceClasses(String filter) { + // Generated convenience method for listDeviceClasses + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + PagedFlux pagedFluxResponse = listDeviceClasses(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClass.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceClasses() { + // Generated convenience method for listDeviceClasses + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDeviceClasses(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClass.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the properties of a device class. + * + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a device class on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeviceClass(String deviceClassId) { + // Generated convenience method for getDeviceClassWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassWithResponse(deviceClassId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClass.class)); + } + + /** + * Update device class details. + * + * @param deviceClassId Device class identifier. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching + * friendlyName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device class metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateDeviceClass(String deviceClassId, PatchBody deviceClassPatch) { + // Generated convenience method for updateDeviceClassWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getPatchBodyAccessor().prepareModelForJsonMergePatch(deviceClassPatch, true); + BinaryData deviceClassPatchInBinaryData = BinaryData.fromObject(deviceClassPatch); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + deviceClassPatchInBinaryData.getLength(); + JsonMergePatchHelper.getPatchBodyAccessor().prepareModelForJsonMergePatch(deviceClassPatch, false); + return updateDeviceClassWithResponse(deviceClassId, deviceClassPatchInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClass.class)); + } + + /** + * Deletes a device class. Device classes are created automatically when Device + * Update-enabled devices are connected to the hub but are not automatically + * cleaned up since they are referenced by DeviceClassSubgroups. If the user has + * deleted all DeviceClassSubgroups for a device class they can also delete the + * device class to remove the records from the system and to stop checking the + * compatibility of this device class with new updates. If a device is ever + * reconnected for this device class it will be re-created. + * + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteDeviceClass(String deviceClassId) { + // Generated convenience method for deleteDeviceClassWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteDeviceClassWithResponse(deviceClassId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Gets a list of installable updates for a device class. + * + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of installable updates for a device class as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listInstallableUpdatesForDeviceClass(String deviceClassId) { + // Generated convenience method for listInstallableUpdatesForDeviceClass + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listInstallableUpdatesForDeviceClass(deviceClassId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(UpdateInfo.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + * @param filter Restricts the set of devices returned. You can filter on GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices connected to Device Update for IoT Hub as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDevices(String filter) { + // Generated convenience method for listDevices + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + PagedFlux pagedFluxResponse = listDevices(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Device.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices connected to Device Update for IoT Hub as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDevices() { + // Generated convenience method for listDevices + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDevices(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Device.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param importType The types of devices to import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportDevices(ImportType importType) { + // Generated convenience method for beginImportDevicesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginImportDevicesWithModelAsync( + BinaryData.fromObject(importType == null ? null : importType.toString()), requestOptions); + } + + /** + * Gets the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub. + * + * @param deviceId Device identifier in Azure IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDevice(String deviceId) { + // Generated convenience method for getDeviceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceWithResponse(deviceId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Device.class)); + } + + /** + * Gets the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub. + * + * @param deviceId Device identifier in Azure IoT Hub. + * @param moduleId Device module identifier in Azure IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeviceModule(String deviceId, String moduleId) { + // Generated convenience method for getDeviceModuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceModuleWithResponse(deviceId, moduleId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Device.class)); + } + + /** + * Gets the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUpdateCompliance() { + // Generated convenience method for getUpdateComplianceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUpdateComplianceWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UpdateCompliance.class)); + } + + /** + * Gets a list of all device groups. The $default group will always be returned + * first. + * + * @param orderBy Orders the set of groups returned. You can order by groupId, deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device groups as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGroups(String orderBy) { + // Generated convenience method for listGroups + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + PagedFlux pagedFluxResponse = listGroups(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Group.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of all device groups. The $default group will always be returned + * first. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device groups as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGroups() { + // Generated convenience method for listGroups + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listGroups(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Group.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the device group properties. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device group properties on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGroup(String groupId) { + // Generated convenience method for getGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getGroupWithResponse(groupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Group.class)); + } + + /** + * Deletes a device group. This group is automatically created when a Device + * Update-enabled device is connected to the hub and reports its properties. + * Groups, subgroups, and deployments are not automatically cleaned up but are + * retained for history purposes. Users can call this method to delete a group if + * they do not need to retain any of the history of the group and no longer need + * it. If a device is ever connected again for this group after the group was + * deleted it will be automatically re-created but there will be no history. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteGroup(String groupId) { + // Generated convenience method for deleteGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteGroupWithResponse(groupId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * 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 groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUpdateComplianceForGroup(String groupId) { + // Generated convenience method for getUpdateComplianceForGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUpdateComplianceForGroupWithResponse(groupId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UpdateCompliance.class)); + } + + /** + * Get the best available updates for a device group and a count of how many + * devices need each update. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the best available updates for a device group and a count of how many + * devices need each update as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listBestUpdatesForGroup(String groupId) { + // Generated convenience method for listBestUpdatesForGroup + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listBestUpdatesForGroup(groupId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase( + pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClassSubgroupUpdatableDevices.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of deployments for a device group. + * + * @param groupId Group identifier. + * @param orderBy Orders the set of deployments returned. You can order by start date. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device group as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForGroup(String groupId, String orderBy) { + // Generated convenience method for listDeploymentsForGroup + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + PagedFlux pagedFluxResponse = listDeploymentsForGroup(groupId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of deployments for a device group. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device group as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForGroup(String groupId) { + // Generated convenience method for listDeploymentsForGroup + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDeploymentsForGroup(groupId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the deployment properties. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment properties on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeployment(String groupId, String deploymentId) { + // Generated convenience method for getDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentWithResponse(groupId, deploymentId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)); + } + + /** + * Creates or updates a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @param deployment The deployment properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateDeployment(String groupId, String deploymentId, Deployment deployment) { + // Generated convenience method for createOrUpdateDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrUpdateDeploymentWithResponse(groupId, deploymentId, BinaryData.fromObject(deployment), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeploymentStatus(String groupId, String deploymentId) { + // Generated convenience method for getDeploymentStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentStatusWithResponse(groupId, deploymentId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeploymentStatus.class)); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @param filter Restricts the set of device class subgroups returned. You can filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2'). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device class subgroups for the group as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceClassSubgroupsForGroup(String groupId, String filter) { + // Generated convenience method for listDeviceClassSubgroupsForGroup + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + PagedFlux pagedFluxResponse = listDeviceClassSubgroupsForGroup(groupId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClassSubgroup.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device class subgroups for the group as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceClassSubgroupsForGroup(String groupId) { + // Generated convenience method for listDeviceClassSubgroupsForGroup + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listDeviceClassSubgroupsForGroup(groupId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClassSubgroup.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device class subgroup details on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeviceClassSubgroup(String groupId, String deviceClassId) { + // Generated convenience method for getDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClassSubgroup.class)); + } + + /** + * Deletes a device class subgroup. This subgroup is automatically created when a + * Device Update-enabled device is connected to the hub and reports its + * properties. Groups, subgroups, and deployments are not automatically cleaned up + * but are retained for history purposes. Users can call this method to delete a + * subgroup if they do not need to retain any of the history of the subgroup and + * no longer need it. If a device is ever connected again for this subgroup after + * the subgroup was deleted it will be automatically re-created but there will be + * no history. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteDeviceClassSubgroup(String groupId, String deviceClassId) { + // Generated convenience method for deleteDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeviceClassSubgroupUpdateCompliance(String groupId, String deviceClassId) { + // Generated convenience method for getDeviceClassSubgroupUpdateComplianceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassSubgroupUpdateComplianceWithResponse(groupId, deviceClassId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UpdateCompliance.class)); + } + + /** + * Get the best available update for a device class subgroup and a count of how + * many devices need this update. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the best available update for a device class subgroup and a count of how + * many devices need this update on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getBestUpdatesForDeviceClassSubgroup(String groupId, + String deviceClassId) { + // Generated convenience method for getBestUpdatesForDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getBestUpdatesForDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClassSubgroupUpdatableDevices.class)); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param orderBy Orders the set of deployments returned. You can order by start date. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId, + String orderBy) { + // Generated convenience method for listDeploymentsForDeviceClassSubgroup + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + PagedFlux pagedFluxResponse + = listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId) { + // Generated convenience method for listDeploymentsForDeviceClassSubgroup + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse + = listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets the deployment properties. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment properties on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeploymentForDeviceClassSubgroup(String groupId, String deviceClassId, + String deploymentId) { + // Generated convenience method for getDeploymentForDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)); + } + + /** + * Stops a deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopDeployment(String groupId, String deviceClassId, String deploymentId) { + // Generated convenience method for stopDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)); + } + + /** + * Retries a deployment with failed devices. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono retryDeployment(String groupId, String deviceClassId, String deploymentId) { + // Generated convenience method for retryDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return retryDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Deployment.class)); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDeviceClassSubgroupDeploymentStatus(String groupId, + String deviceClassId, String deploymentId) { + // Generated convenience method for getDeviceClassSubgroupDeploymentStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassSubgroupDeploymentStatusWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeviceClassSubgroupDeploymentStatus.class)); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param filter Restricts the set of deployment device states returned. You can filter on + * deviceId and moduleId and/or deviceState. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices in a deployment along with their state as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, + String deviceClassId, String deploymentId, String filter) { + // Generated convenience method for listDeviceStatesForDeviceClassSubgroupDeployment + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + PagedFlux pagedFluxResponse + = listDeviceStatesForDeviceClassSubgroupDeployment(groupId, deviceClassId, deploymentId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeploymentDeviceState.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices in a deployment along with their state as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, + String deviceClassId, String deploymentId) { + // Generated convenience method for listDeviceStatesForDeviceClassSubgroupDeployment + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse + = listDeviceStatesForDeviceClassSubgroupDeployment(groupId, deviceClassId, deploymentId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeploymentDeviceState.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOperationStatus(String operationId, String ifNoneMatch) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getOperationStatusWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeviceOperation.class)); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOperationStatus(String operationId) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationStatusWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DeviceOperation.class)); + } + + /** + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + * + * @param filter Restricts the set of operations returned. Only one specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'". + * @param top Specifies a non-negative integer n that limits the number of items returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device import operations as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationStatuses(String filter, Integer top) { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + PagedFlux pagedFluxResponse = listOperationStatuses(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceOperation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device import operations as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationStatuses() { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listOperationStatuses(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceOperation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Start the device diagnostics log collection on specified devices. + * + * @param logCollectionId Log collection identifier. + * @param logCollection The log collection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostics request body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startLogCollection(String logCollectionId, LogCollection logCollection) { + // Generated convenience method for startLogCollectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return startLogCollectionWithResponse(logCollectionId, BinaryData.fromObject(logCollection), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LogCollection.class)); + } + + /** + * Get the device diagnostics log collection. + * + * @param logCollectionId Log collection identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device diagnostics log collection on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLogCollection(String logCollectionId) { + // Generated convenience method for getLogCollectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLogCollectionWithResponse(logCollectionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LogCollection.class)); + } + + /** + * Get all device diagnostics log collections. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all device diagnostics log collections as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLogCollections() { + // Generated convenience method for listLogCollections + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listLogCollections(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(LogCollection.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get log collection with detailed status. + * + * @param logCollectionId Log collection identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log collection with detailed status on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getLogCollectionDetailedStatus(String logCollectionId) { + // Generated convenience method for getLogCollectionDetailedStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLogCollectionDetailedStatusWithResponse(logCollectionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LogCollectionOperationDetailedStatus.class)); + } + + /** + * Get list of device health. + * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of device health as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listHealthOfDevices(String filter) { + // Generated convenience method for listHealthOfDevices + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listHealthOfDevices(filter, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DeviceHealth.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deletes a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteDeployment(String groupId, String deploymentId) { + // Generated convenience method for deleteDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteDeploymentWithResponse(groupId, deploymentId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteDeploymentForDeviceClassSubgroup(String groupId, String deviceClassId, + String deploymentId) { + // Generated convenience method for deleteDeploymentForDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .flatMap(FluxUtil::toMono); + } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java index 39f48d7d53ad..0562d926474f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate; @@ -12,22 +12,43 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.polling.SyncPoller; import com.azure.iot.deviceupdate.implementation.DeviceManagementsImpl; +import com.azure.iot.deviceupdate.implementation.JsonMergePatchHelper; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.DeploymentDeviceState; +import com.azure.iot.deviceupdate.models.DeploymentStatus; +import com.azure.iot.deviceupdate.models.Device; +import com.azure.iot.deviceupdate.models.DeviceClass; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroup; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices; +import com.azure.iot.deviceupdate.models.DeviceHealth; +import com.azure.iot.deviceupdate.models.DeviceOperation; +import com.azure.iot.deviceupdate.models.Group; +import com.azure.iot.deviceupdate.models.ImportType; +import com.azure.iot.deviceupdate.models.LogCollection; +import com.azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus; +import com.azure.iot.deviceupdate.models.PatchBody; +import com.azure.iot.deviceupdate.models.UpdateCompliance; +import com.azure.iot.deviceupdate.models.UpdateInfo; -/** Initializes a new instance of the synchronous DeviceUpdateClient type. */ -@ServiceClient(builder = DeviceManagementClientBuilder.class) +/** + * Initializes a new instance of the synchronous DeviceUpdateClient type. + */ +@ServiceClient(builder = DeviceUpdateClientBuilder.class) public final class DeviceManagementClient { @Generated private final DeviceManagementsImpl serviceClient; /** * Initializes an instance of DeviceManagementClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -36,60 +57,56 @@ public final class DeviceManagementClient { } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on friendly name.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on + * friendly name.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             friendlyName: String (Optional)
-     *             deviceClassProperties (Required): {
-     *                 contractModel (Optional): {
-     *                     id: String (Required)
-     *                     name: String (Required)
-     *                 }
-     *                 compatProperties (Required): {
-     *                     String: String (Required)
-     *                 }
-     *             }
-     *             bestCompatibleUpdate (Optional): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
+     *     deviceClassId: String (Required)
+     *     friendlyName: String (Optional)
+     *     deviceClassProperties (Required): {
+     *         contractModel (Optional): {
+     *             id: String (Required)
+     *             name: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         compatProperties (Required): {
+     *             String: String (Required)
+     *         }
+     *     }
+     *     bestCompatibleUpdate (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 as paginated response with {@link PagedIterable}. + * @return 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 as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -99,10 +116,10 @@ public PagedIterable listDeviceClasses(RequestOptions requestOptions /** * Gets the properties of a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -125,8 +142,9 @@ public PagedIterable listDeviceClasses(RequestOptions requestOptions
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -143,18 +161,20 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req /** * Update device class details. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
-     *     friendlyName: String (Required)
+     *     friendlyName: String (Optional, Required on create)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -177,10 +197,12 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. - * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching + * friendlyName. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -196,12 +218,14 @@ public Response updateDeviceClassWithResponse(String deviceClassId, } /** - * Deletes a device class. Device classes are created automatically when Device Update-enabled devices are connected - * to the hub but are not automatically cleaned up since they are referenced by DeviceClassSubgroups. If the user - * has deleted all DeviceClassSubgroups for a device class they can also delete the device class to remove the - * records from the system and to stop checking the compatibility of this device class with new updates. If a device - * is ever reconnected for this device class it will be re-created. - * + * Deletes a device class. Device classes are created automatically when Device + * Update-enabled devices are connected to the hub but are not automatically + * cleaned up since they are referenced by DeviceClassSubgroups. If the user has + * deleted all DeviceClassSubgroups for a device class they can also delete the + * device class to remove the records from the system and to stop checking the + * compatibility of this device class with new updates. If a device is ever + * reconnected for this device class it will be re-created. + * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -218,26 +242,22 @@ public Response deleteDeviceClassWithResponse(String deviceClassId, Reques /** * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             updateId (Required): {
-     *                 provider: String (Required)
-     *                 name: String (Required)
-     *                 version: String (Required)
-     *             }
-     *             description: String (Optional)
-     *             friendlyName: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     friendlyName: String (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -255,67 +275,63 @@ public PagedIterable listInstallableUpdatesForDeviceClass(String dev /** * Gets a list of devices connected to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to query for devices with no deployment status (that have never been deployed to).
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on + * GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to).
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             deviceClassId: String (Required)
-     *             groupId: String (Optional)
-     *             lastAttemptedUpdate (Optional): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Optional)
+     *     lastAttemptedUpdate (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed) (Optional)
+     *     installedUpdate (Optional): (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean (Required)
+     *     lastDeploymentId: String (Optional)
+     *     lastInstallResult (Optional): {
+     *         resultCode: int (Required)
+     *         extendedResultCode: int (Required)
+     *         resultDetails: String (Optional)
+     *         stepResults (Optional): [
+     *              (Optional){
+     *                 update (Optional): (recursive schema, see update above)
      *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed) (Optional)
-     *             installedUpdate (Optional): (recursive schema, see installedUpdate above)
-     *             onLatestUpdate: boolean (Required)
-     *             lastDeploymentId: String (Optional)
-     *             lastInstallResult (Optional): {
      *                 resultCode: int (Required)
      *                 extendedResultCode: int (Required)
      *                 resultDetails: String (Optional)
-     *                 stepResults (Optional): [
-     *                      (Optional){
-     *                         update (Optional): (recursive schema, see update above)
-     *                         description: String (Optional)
-     *                         resultCode: int (Required)
-     *                         extendedResultCode: int (Required)
-     *                         resultDetails: String (Optional)
-     *                     }
-     *                 ]
      *             }
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         ]
+     *     }
+     * }
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of devices connected to Device Update for IoT Hub as paginated response with {@link - * PagedIterable}. + * @return a list of devices connected to Device Update for IoT Hub as paginated response with + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -324,15 +340,16 @@ public PagedIterable listDevices(RequestOptions requestOptions) { } /** - * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header - * value to check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import existing devices from IoT Hub. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * String(Devices/Modules/All)
-     * }
- * + * } + *
+ * * @param importType The types of devices to import. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -348,11 +365,12 @@ public SyncPoller beginImportDevices(BinaryData importTy } /** - * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device properties and latest deployment status for a device connected
+     * to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -386,16 +404,17 @@ public SyncPoller beginImportDevices(BinaryData importTy
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub - * along with {@link Response}. + * @return the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -404,12 +423,12 @@ public Response getDeviceWithResponse(String deviceId, RequestOption } /** - * Gets the device module properties and latest deployment status for a device module connected to Device Update for - * IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device module properties and latest deployment status for a device
+     * module connected to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -443,8 +462,9 @@ public Response getDeviceWithResponse(String deviceId, RequestOption
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param moduleId Device module identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -452,8 +472,8 @@ public Response getDeviceWithResponse(String deviceId, RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device module properties and latest deployment status for a device module connected to Device Update - * for IoT Hub along with {@link Response}. + * @return the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -463,27 +483,28 @@ public Response getDeviceModuleWithResponse(String deviceId, String } /** - * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress - * receiving new updates. - * - *

Response Body Schema - * - *

{@code
+     * Gets the breakdown of how many devices are on their latest update, have new
+     * updates available, or are in progress receiving new updates.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the breakdown of how many devices are on their latest update, have new updates available, or are in - * progress receiving new updates along with {@link Response}. + * @return the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -492,40 +513,37 @@ public Response getUpdateComplianceWithResponse(RequestOptions reque } /** - * Gets a list of all device groups. The $default group will always be returned first. - * - *

Query Parameters - * + * Gets a list of all device groups. The $default group will always be returned + * first. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, + * deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             groupType: String(IoTHubTag/DefaultNoTag) (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
-     *             subgroupsWithUpdatesInProgressCount: Integer (Optional)
-     *             subgroupsWithOnLatestUpdateCount: Integer (Optional)
-     *             deployments (Optional): [
-     *                 String (Optional)
-     *             ]
-     *         }
+     *     groupId: String (Required)
+     *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
+     *     subgroupsWithUpdatesInProgressCount: Integer (Optional)
+     *     subgroupsWithOnLatestUpdateCount: Integer (Optional)
+     *     deployments (Optional): [
+     *         String (Optional)
      *     ]
-     *     nextLink: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -541,10 +559,10 @@ public PagedIterable listGroups(RequestOptions requestOptions) { /** * Gets the device group properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -557,8 +575,9 @@ public PagedIterable listGroups(RequestOptions requestOptions) {
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -574,12 +593,14 @@ public Response getGroupWithResponse(String groupId, RequestOptions } /** - * Deletes a device group. This group is automatically created when a Device Update-enabled device is connected to - * the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned up but are - * retained for history purposes. Users can call this method to delete a group if they do not need to retain any of - * the history of the group and no longer need it. If a device is ever connected again for this group after the - * group was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device group. This group is automatically created when a Device + * Update-enabled device is connected to the hub and reports its properties. + * Groups, subgroups, and deployments are not automatically cleaned up but are + * retained for history purposes. Users can call this method to delete a group if + * they do not need to retain any of the history of the group and no longer need + * it. If a device is ever connected again for this group after the group was + * deleted it will be automatically re-created but there will be no history. + * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -595,28 +616,31 @@ public Response deleteGroupWithResponse(String groupId, RequestOptions req } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link Response}. + * @return 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 along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -625,40 +649,37 @@ public Response getUpdateComplianceForGroupWithResponse(String group } /** - * Get the best available updates for a device group and a count of how many devices need each update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             deviceClassId: String (Required)
-     *             update (Required): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             deviceCount: int (Required)
+     *     groupId: String (Required)
+     *     deviceClassId: String (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     deviceCount: int (Required)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available updates for a device group and a count of how many devices need each update as - * paginated response with {@link PagedIterable}. + * @return the best available updates for a device group and a count of how many + * devices need each update as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -668,54 +689,49 @@ public PagedIterable listBestUpdatesForGroup(String groupId, Request /** * Gets a list of deployments for a device group. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deploymentId: String (Required)
-     *             startDateTime: OffsetDateTime (Required)
-     *             update (Required): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             groupId: String (Required)
-     *             deviceClassSubgroups (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             isCanceled: Boolean (Optional)
-     *             isRetried: Boolean (Optional)
-     *             rollbackPolicy (Optional): {
-     *                 update (Required): (recursive schema, see update above)
-     *                 failure (Required): {
-     *                     devicesFailedPercentage: int (Required)
-     *                     devicesFailedCount: int (Required)
-     *                 }
-     *             }
-     *             isCloudInitiatedRollback: Boolean (Optional)
+     *     deploymentId: String (Required)
+     *     startDateTime: OffsetDateTime (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     groupId: String (Required)
+     *     deviceClassSubgroups (Optional): [
+     *         String (Optional)
      *     ]
-     *     nextLink: String (Optional)
+     *     isCanceled: Boolean (Optional)
+     *     isRetried: Boolean (Optional)
+     *     rollbackPolicy (Optional): {
+     *         update (Required): (recursive schema, see update above)
+     *         failure (Required): {
+     *             devicesFailedPercentage: int (Required)
+     *             devicesFailedCount: int (Required)
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -732,10 +748,10 @@ public PagedIterable listDeploymentsForGroup(String groupId, Request /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -762,9 +778,11 @@ public PagedIterable listDeploymentsForGroup(String groupId, Request
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -783,10 +801,10 @@ public Response getDeploymentWithResponse(String groupId, String dep /** * Creates or updates a deployment. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -813,12 +831,15 @@ public Response getDeploymentWithResponse(String groupId, String dep
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -845,9 +866,11 @@ public Response getDeploymentWithResponse(String groupId, String dep
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param deployment The deployment properties. @@ -867,31 +890,12 @@ public Response createOrUpdateDeploymentWithResponse(String groupId, } /** - * Deletes a deployment. - * - * @param groupId Group identifier. - * @param deploymentId Deployment identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeploymentWithResponse(String groupId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.deleteDeploymentWithResponse(groupId, deploymentId, requestOptions); - } - - /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled) (Required)
@@ -924,8 +928,9 @@ public Response deleteDeploymentWithResponse(String groupId, String deploy
      *         }
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -933,8 +938,8 @@ public Response deleteDeploymentWithResponse(String groupId, String deploy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -944,36 +949,33 @@ public Response getDeploymentStatusWithResponse(String groupId, Stri } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2')
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can + * filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2')
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             groupId: String (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             deploymentId: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -989,12 +991,13 @@ public PagedIterable listDeviceClassSubgroupsForGroup(String groupId } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -1002,8 +1005,9 @@ public PagedIterable listDeviceClassSubgroupsForGroup(String groupId
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1021,12 +1025,15 @@ public Response getDeviceClassSubgroupWithResponse(String groupId, S } /** - * Deletes a device class subgroup. This subgroup is automatically created when a Device Update-enabled device is - * connected to the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned - * up but are retained for history purposes. Users can call this method to delete a subgroup if they do not need to - * retain any of the history of the subgroup and no longer need it. If a device is ever connected again for this - * subgroup after the subgroup was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device class subgroup. This subgroup is automatically created when a + * Device Update-enabled device is connected to the hub and reports its + * properties. Groups, subgroups, and deployments are not automatically cleaned up + * but are retained for history purposes. Users can call this method to delete a + * subgroup if they do not need to retain any of the history of the subgroup and + * no longer need it. If a device is ever connected again for this subgroup after + * the subgroup was deleted it will be automatically re-created but there will be + * no history. + * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1044,20 +1051,22 @@ public Response deleteDeviceClassSubgroupWithResponse(String groupId, Stri } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1065,9 +1074,9 @@ public Response deleteDeviceClassSubgroupWithResponse(String groupId, Stri * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link - * Response}. + * @return 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 along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1078,11 +1087,12 @@ public Response getDeviceClassSubgroupUpdateComplianceWithResponse(S } /** - * Get the best available update for a device class subgroup and a count of how many devices need this update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available update for a device class subgroup and a count of how
+     * many devices need this update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -1097,8 +1107,9 @@ public Response getDeviceClassSubgroupUpdateComplianceWithResponse(S
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1106,8 +1117,8 @@ public Response getDeviceClassSubgroupUpdateComplianceWithResponse(S * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available update for a device class subgroup and a count of how many devices need this update - * along with {@link Response}. + * @return the best available update for a device class subgroup and a count of how + * many devices need this update along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1119,54 +1130,49 @@ public Response getBestUpdatesForDeviceClassSubgroupWithResponse(Str /** * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deploymentId: String (Required)
-     *             startDateTime: OffsetDateTime (Required)
-     *             update (Required): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             groupId: String (Required)
-     *             deviceClassSubgroups (Optional): [
-     *                 String (Optional)
-     *             ]
-     *             isCanceled: Boolean (Optional)
-     *             isRetried: Boolean (Optional)
-     *             rollbackPolicy (Optional): {
-     *                 update (Required): (recursive schema, see update above)
-     *                 failure (Required): {
-     *                     devicesFailedPercentage: int (Required)
-     *                     devicesFailedCount: int (Required)
-     *                 }
-     *             }
-     *             isCloudInitiatedRollback: Boolean (Optional)
+     *     deploymentId: String (Required)
+     *     startDateTime: OffsetDateTime (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     groupId: String (Required)
+     *     deviceClassSubgroups (Optional): [
+     *         String (Optional)
      *     ]
-     *     nextLink: String (Optional)
+     *     isCanceled: Boolean (Optional)
+     *     isRetried: Boolean (Optional)
+     *     rollbackPolicy (Optional): {
+     *         update (Required): (recursive schema, see update above)
+     *         failure (Required): {
+     *             devicesFailedPercentage: int (Required)
+     *             devicesFailedCount: int (Required)
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1185,10 +1191,10 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup(String gr /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1215,9 +1221,11 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup(String gr
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1236,33 +1244,12 @@ public Response getDeploymentForDeviceClassSubgroupWithResponse(Stri requestOptions); } - /** - * Deletes a device class subgroup deployment. - * - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.deleteDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, - deploymentId, requestOptions); - } - /** * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1289,9 +1276,11 @@ public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1311,10 +1300,10 @@ public Response stopDeploymentWithResponse(String groupId, String de /** * Retries a deployment with failed devices. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1341,9 +1330,11 @@ public Response stopDeploymentWithResponse(String groupId, String de
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1362,12 +1353,12 @@ public Response retryDeploymentWithResponse(String groupId, String d } /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -1393,8 +1384,9 @@ public Response retryDeploymentWithResponse(String groupId, String d
      *     devicesCompletedSucceededCount: Integer (Optional)
      *     devicesCanceledCount: Integer (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1403,8 +1395,8 @@ public Response retryDeploymentWithResponse(String groupId, String d * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -1415,35 +1407,31 @@ public Response getDeviceClassSubgroupDeploymentStatusWithResponse(S } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. - * - *

Query Parameters - * + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can + * filter on + * deviceId and moduleId and/or deviceState.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             retryCount: int (Required)
-     *             movedOnToNewDeployment: boolean (Required)
-     *             deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     retryCount: int (Required)
+     *     movedOnToNewDeployment: boolean (Required)
+     *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1452,8 +1440,8 @@ public Response getDeviceClassSubgroupDeploymentStatusWithResponse(S * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of devices in a deployment along with their state as paginated response with {@link - * PagedIterable}. + * @return a list of devices in a deployment along with their state as paginated response with + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -1465,20 +1453,19 @@ public PagedIterable listDeviceStatesForDeviceClassSubgroupDeploymen /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -1502,8 +1489,9 @@ public PagedIterable listDeviceStatesForDeviceClassSubgroupDeploymen
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1519,52 +1507,51 @@ public Response getOperationStatusWithResponse(String operationId, R } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. - * - *

Query Parameters - * + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             operationId: String (Required)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             error (Optional): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Optional)
-     *                     errorDetail: String (Optional)
-     *                     innerError (Optional): (recursive schema, see innerError above)
-     *                 }
-     *                 occurredDateTime: OffsetDateTime (Optional)
-     *             }
-     *             traceId: String (Optional)
-     *             lastActionDateTime: OffsetDateTime (Required)
-     *             createdDateTime: OffsetDateTime (Required)
-     *             etag: String (Optional)
+     *     operationId: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Required)
+     *             message: String (Optional)
+     *             errorDetail: String (Optional)
+     *             innerError (Optional): (recursive schema, see innerError above)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
-     * }
-     * }
- * + * occurredDateTime: OffsetDateTime (Optional) + * } + * traceId: String (Optional) + * lastActionDateTime: OffsetDateTime (Required) + * createdDateTime: OffsetDateTime (Required) + * etag: String (Optional) + * } + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1580,10 +1567,10 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt /** * Start the device diagnostics log collection on specified devices. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -1597,11 +1584,13 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -1615,8 +1604,9 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param logCollection The log collection properties. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1635,10 +1625,10 @@ public Response startLogCollectionWithResponse(String logCollectionI /** * Get the device diagnostics log collection. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -1652,8 +1642,9 @@ public Response startLogCollectionWithResponse(String logCollectionI
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1670,30 +1661,26 @@ public Response getLogCollectionWithResponse(String logCollectionId, /** * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
      *          (Required){
-     *             operationId: String (Optional)
-     *             deviceList (Required): [
-     *                  (Required){
-     *                     deviceId: String (Required)
-     *                     moduleId: String (Optional)
-     *                 }
-     *             ]
-     *             description: String (Optional)
-     *             createdDateTime: String (Optional)
-     *             lastActionDateTime: String (Optional)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Optional)
+     *             deviceId: String (Required)
+     *             moduleId: String (Optional)
      *         }
      *     ]
-     *     nextLink: String (Optional)
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1709,10 +1696,10 @@ public PagedIterable listLogCollections(RequestOptions requestOption /** * Get log collection with detailed status. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     createdDateTime: String (Optional)
@@ -1730,8 +1717,9 @@ public PagedIterable listLogCollections(RequestOptions requestOption
      *     ]
      *     description: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1749,31 +1737,27 @@ public Response getLogCollectionDetailedStatusWithResponse(String lo /** * Get list of device health. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     state: String(healthy/unhealthy) (Required)
+     *     digitalTwinModelId: String (Optional)
+     *     healthChecks (Required): [
      *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             state: String(healthy/unhealthy) (Required)
-     *             digitalTwinModelId: String (Optional)
-     *             healthChecks (Required): [
-     *                  (Required){
-     *                     name: String (Optional)
-     *                     result: String(success/userError) (Optional)
-     *                 }
-     *             ]
+     *             name: String (Optional)
+     *             result: String(success/userError) (Optional)
      *         }
      *     ]
-     *     nextLink: String (Optional)
      * }
-     * }
- * - * @param filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * } + *
+ * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1786,4 +1770,1180 @@ public Response getLogCollectionDetailedStatusWithResponse(String lo public PagedIterable listHealthOfDevices(String filter, RequestOptions requestOptions) { return this.serviceClient.listHealthOfDevices(filter, requestOptions); } + + /** + * Deletes a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeploymentWithResponse(String groupId, String deploymentId, + RequestOptions requestOptions) { + return this.serviceClient.deleteDeploymentWithResponse(groupId, deploymentId, requestOptions); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, + String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.deleteDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, + deploymentId, requestOptions); + } + + /** + * 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. + * + * @param filter Restricts the set of device classes returned. You can filter on friendly name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeviceClasses(String filter) { + // Generated convenience method for listDeviceClasses + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + return serviceClient.listDeviceClasses(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceClass.class)); + } + + /** + * 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. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeviceClasses() { + // Generated convenience method for listDeviceClasses + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listDeviceClasses(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceClass.class)); + } + + /** + * Gets the properties of a device class. + * + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a device class. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceClass getDeviceClass(String deviceClassId) { + // Generated convenience method for getDeviceClassWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassWithResponse(deviceClassId, requestOptions).getValue().toObject(DeviceClass.class); + } + + /** + * Update device class details. + * + * @param deviceClassId Device class identifier. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching + * friendlyName. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device class metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceClass updateDeviceClass(String deviceClassId, PatchBody deviceClassPatch) { + // Generated convenience method for updateDeviceClassWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getPatchBodyAccessor().prepareModelForJsonMergePatch(deviceClassPatch, true); + BinaryData deviceClassPatchInBinaryData = BinaryData.fromObject(deviceClassPatch); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + deviceClassPatchInBinaryData.getLength(); + JsonMergePatchHelper.getPatchBodyAccessor().prepareModelForJsonMergePatch(deviceClassPatch, false); + return updateDeviceClassWithResponse(deviceClassId, deviceClassPatchInBinaryData, requestOptions).getValue() + .toObject(DeviceClass.class); + } + + /** + * Deletes a device class. Device classes are created automatically when Device + * Update-enabled devices are connected to the hub but are not automatically + * cleaned up since they are referenced by DeviceClassSubgroups. If the user has + * deleted all DeviceClassSubgroups for a device class they can also delete the + * device class to remove the records from the system and to stop checking the + * compatibility of this device class with new updates. If a device is ever + * reconnected for this device class it will be re-created. + * + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDeviceClass(String deviceClassId) { + // Generated convenience method for deleteDeviceClassWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteDeviceClassWithResponse(deviceClassId, requestOptions).getValue(); + } + + /** + * Gets a list of installable updates for a device class. + * + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of installable updates for a device class as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listInstallableUpdatesForDeviceClass(String deviceClassId) { + // Generated convenience method for listInstallableUpdatesForDeviceClass + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listInstallableUpdatesForDeviceClass(deviceClassId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(UpdateInfo.class)); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + * @param filter Restricts the set of devices returned. You can filter on GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices connected to Device Update for IoT Hub as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDevices(String filter) { + // Generated convenience method for listDevices + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + return serviceClient.listDevices(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Device.class)); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices connected to Device Update for IoT Hub as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDevices() { + // Generated convenience method for listDevices + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listDevices(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Device.class)); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param importType The types of devices to import. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportDevices(ImportType importType) { + // Generated convenience method for beginImportDevicesWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginImportDevicesWithModel( + BinaryData.fromObject(importType == null ? null : importType.toString()), requestOptions); + } + + /** + * Gets the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub. + * + * @param deviceId Device identifier in Azure IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Device getDevice(String deviceId) { + // Generated convenience method for getDeviceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceWithResponse(deviceId, requestOptions).getValue().toObject(Device.class); + } + + /** + * Gets the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub. + * + * @param deviceId Device identifier in Azure IoT Hub. + * @param moduleId Device module identifier in Azure IoT Hub. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Device getDeviceModule(String deviceId, String moduleId) { + // Generated convenience method for getDeviceModuleWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceModuleWithResponse(deviceId, moduleId, requestOptions).getValue().toObject(Device.class); + } + + /** + * Gets the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateCompliance getUpdateCompliance() { + // Generated convenience method for getUpdateComplianceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUpdateComplianceWithResponse(requestOptions).getValue().toObject(UpdateCompliance.class); + } + + /** + * Gets a list of all device groups. The $default group will always be returned + * first. + * + * @param orderBy Orders the set of groups returned. You can order by groupId, deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device groups as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroups(String orderBy) { + // Generated convenience method for listGroups + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + return serviceClient.listGroups(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Group.class)); + } + + /** + * Gets a list of all device groups. The $default group will always be returned + * first. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device groups as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroups() { + // Generated convenience method for listGroups + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listGroups(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Group.class)); + } + + /** + * Gets the device group properties. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device group properties. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Group getGroup(String groupId) { + // Generated convenience method for getGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getGroupWithResponse(groupId, requestOptions).getValue().toObject(Group.class); + } + + /** + * Deletes a device group. This group is automatically created when a Device + * Update-enabled device is connected to the hub and reports its properties. + * Groups, subgroups, and deployments are not automatically cleaned up but are + * retained for history purposes. Users can call this method to delete a group if + * they do not need to retain any of the history of the group and no longer need + * it. If a device is ever connected again for this group after the group was + * deleted it will be automatically re-created but there will be no history. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteGroup(String groupId) { + // Generated convenience method for deleteGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteGroupWithResponse(groupId, requestOptions).getValue(); + } + + /** + * 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 groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateCompliance getUpdateComplianceForGroup(String groupId) { + // Generated convenience method for getUpdateComplianceForGroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUpdateComplianceForGroupWithResponse(groupId, requestOptions).getValue() + .toObject(UpdateCompliance.class); + } + + /** + * Get the best available updates for a device group and a count of how many + * devices need each update. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the best available updates for a device group and a count of how many + * devices need each update as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBestUpdatesForGroup(String groupId) { + // Generated convenience method for listBestUpdatesForGroup + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listBestUpdatesForGroup(groupId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceClassSubgroupUpdatableDevices.class)); + } + + /** + * Gets a list of deployments for a device group. + * + * @param groupId Group identifier. + * @param orderBy Orders the set of deployments returned. You can order by start date. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device group as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForGroup(String groupId, String orderBy) { + // Generated convenience method for listDeploymentsForGroup + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + return serviceClient.listDeploymentsForGroup(groupId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Deployment.class)); + } + + /** + * Gets a list of deployments for a device group. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device group as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForGroup(String groupId) { + // Generated convenience method for listDeploymentsForGroup + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listDeploymentsForGroup(groupId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Deployment.class)); + } + + /** + * Gets the deployment properties. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment properties. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Deployment getDeployment(String groupId, String deploymentId) { + // Generated convenience method for getDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentWithResponse(groupId, deploymentId, requestOptions).getValue().toObject(Deployment.class); + } + + /** + * Creates or updates a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @param deployment The deployment properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Deployment createOrUpdateDeployment(String groupId, String deploymentId, Deployment deployment) { + // Generated convenience method for createOrUpdateDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOrUpdateDeploymentWithResponse(groupId, deploymentId, BinaryData.fromObject(deployment), + requestOptions).getValue().toObject(Deployment.class); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeploymentStatus getDeploymentStatus(String groupId, String deploymentId) { + // Generated convenience method for getDeploymentStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentStatusWithResponse(groupId, deploymentId, requestOptions).getValue() + .toObject(DeploymentStatus.class); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @param filter Restricts the set of device class subgroups returned. You can filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2'). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device class subgroups for the group as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeviceClassSubgroupsForGroup(String groupId, String filter) { + // Generated convenience method for listDeviceClassSubgroupsForGroup + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + return serviceClient.listDeviceClassSubgroupsForGroup(groupId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceClassSubgroup.class)); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device class subgroups for the group as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeviceClassSubgroupsForGroup(String groupId) { + // Generated convenience method for listDeviceClassSubgroupsForGroup + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listDeviceClassSubgroupsForGroup(groupId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceClassSubgroup.class)); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return device class subgroup details. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceClassSubgroup getDeviceClassSubgroup(String groupId, String deviceClassId) { + // Generated convenience method for getDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).getValue() + .toObject(DeviceClassSubgroup.class); + } + + /** + * Deletes a device class subgroup. This subgroup is automatically created when a + * Device Update-enabled device is connected to the hub and reports its + * properties. Groups, subgroups, and deployments are not automatically cleaned up + * but are retained for history purposes. Users can call this method to delete a + * subgroup if they do not need to retain any of the history of the subgroup and + * no longer need it. If a device is ever connected again for this subgroup after + * the subgroup was deleted it will be automatically re-created but there will be + * no history. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDeviceClassSubgroup(String groupId, String deviceClassId) { + // Generated convenience method for deleteDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).getValue(); + } + + /** + * 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. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateCompliance getDeviceClassSubgroupUpdateCompliance(String groupId, String deviceClassId) { + // Generated convenience method for getDeviceClassSubgroupUpdateComplianceWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassSubgroupUpdateComplianceWithResponse(groupId, deviceClassId, requestOptions).getValue() + .toObject(UpdateCompliance.class); + } + + /** + * Get the best available update for a device class subgroup and a count of how + * many devices need this update. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the best available update for a device class subgroup and a count of how + * many devices need this update. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceClassSubgroupUpdatableDevices getBestUpdatesForDeviceClassSubgroup(String groupId, + String deviceClassId) { + // Generated convenience method for getBestUpdatesForDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getBestUpdatesForDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).getValue() + .toObject(DeviceClassSubgroupUpdatableDevices.class); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param orderBy Orders the set of deployments returned. You can order by start date. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId, + String orderBy) { + // Generated convenience method for listDeploymentsForDeviceClassSubgroup + RequestOptions requestOptions = new RequestOptions(); + if (orderBy != null) { + requestOptions.addQueryParam("orderby", orderBy, false); + } + return serviceClient.listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Deployment.class)); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId) { + // Generated convenience method for listDeploymentsForDeviceClassSubgroup + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Deployment.class)); + } + + /** + * Gets the deployment properties. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the deployment properties. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Deployment getDeploymentForDeviceClassSubgroup(String groupId, String deviceClassId, String deploymentId) { + // Generated convenience method for getDeploymentForDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .getValue() + .toObject(Deployment.class); + } + + /** + * Stops a deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Deployment stopDeployment(String groupId, String deviceClassId, String deploymentId) { + // Generated convenience method for stopDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions).getValue() + .toObject(Deployment.class); + } + + /** + * Retries a deployment with failed devices. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return deployment metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Deployment retryDeployment(String groupId, String deviceClassId, String deploymentId) { + // Generated convenience method for retryDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + return retryDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions).getValue() + .toObject(Deployment.class); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceClassSubgroupDeploymentStatus getDeviceClassSubgroupDeploymentStatus(String groupId, + String deviceClassId, String deploymentId) { + // Generated convenience method for getDeviceClassSubgroupDeploymentStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getDeviceClassSubgroupDeploymentStatusWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .getValue() + .toObject(DeviceClassSubgroupDeploymentStatus.class); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param filter Restricts the set of deployment device states returned. You can filter on + * deviceId and moduleId and/or deviceState. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices in a deployment along with their state as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, + String deviceClassId, String deploymentId, String filter) { + // Generated convenience method for listDeviceStatesForDeviceClassSubgroupDeployment + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + return serviceClient + .listDeviceStatesForDeviceClassSubgroupDeployment(groupId, deviceClassId, deploymentId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeploymentDeviceState.class)); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of devices in a deployment along with their state as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, + String deviceClassId, String deploymentId) { + // Generated convenience method for listDeviceStatesForDeviceClassSubgroupDeployment + RequestOptions requestOptions = new RequestOptions(); + return serviceClient + .listDeviceStatesForDeviceClassSubgroupDeployment(groupId, deviceClassId, deploymentId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeploymentDeviceState.class)); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceOperation getOperationStatus(String operationId, String ifNoneMatch) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getOperationStatusWithResponse(operationId, requestOptions).getValue().toObject(DeviceOperation.class); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DeviceOperation getOperationStatus(String operationId) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationStatusWithResponse(operationId, requestOptions).getValue().toObject(DeviceOperation.class); + } + + /** + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + * + * @param filter Restricts the set of operations returned. Only one specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'". + * @param top Specifies a non-negative integer n that limits the number of items returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device import operations as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperationStatuses(String filter, Integer top) { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return serviceClient.listOperationStatuses(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceOperation.class)); + } + + /** + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all device import operations as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperationStatuses() { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listOperationStatuses(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceOperation.class)); + } + + /** + * Start the device diagnostics log collection on specified devices. + * + * @param logCollectionId Log collection identifier. + * @param logCollection The log collection properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return diagnostics request body. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LogCollection startLogCollection(String logCollectionId, LogCollection logCollection) { + // Generated convenience method for startLogCollectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return startLogCollectionWithResponse(logCollectionId, BinaryData.fromObject(logCollection), requestOptions) + .getValue() + .toObject(LogCollection.class); + } + + /** + * Get the device diagnostics log collection. + * + * @param logCollectionId Log collection identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the device diagnostics log collection. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LogCollection getLogCollection(String logCollectionId) { + // Generated convenience method for getLogCollectionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLogCollectionWithResponse(logCollectionId, requestOptions).getValue().toObject(LogCollection.class); + } + + /** + * Get all device diagnostics log collections. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return all device diagnostics log collections as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLogCollections() { + // Generated convenience method for listLogCollections + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listLogCollections(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(LogCollection.class)); + } + + /** + * Get log collection with detailed status. + * + * @param logCollectionId Log collection identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return log collection with detailed status. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public LogCollectionOperationDetailedStatus getLogCollectionDetailedStatus(String logCollectionId) { + // Generated convenience method for getLogCollectionDetailedStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getLogCollectionDetailedStatusWithResponse(logCollectionId, requestOptions).getValue() + .toObject(LogCollectionOperationDetailedStatus.class); + } + + /** + * Get list of device health. + * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of device health as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listHealthOfDevices(String filter) { + // Generated convenience method for listHealthOfDevices + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listHealthOfDevices(filter, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceHealth.class)); + } + + /** + * Deletes a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDeployment(String groupId, String deploymentId) { + // Generated convenience method for deleteDeploymentWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteDeploymentWithResponse(groupId, deploymentId, requestOptions).getValue(); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteDeploymentForDeviceClassSubgroup(String groupId, String deviceClassId, String deploymentId) { + // Generated convenience method for deleteDeploymentForDeviceClassSubgroupWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .getValue(); + } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java index 0c4d2df328eb..b1b68c206d21 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate; @@ -12,15 +12,28 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.iot.deviceupdate.implementation.DeviceUpdatesImpl; +import com.azure.iot.deviceupdate.models.ImportUpdateInputItem; +import com.azure.iot.deviceupdate.models.Update; +import com.azure.iot.deviceupdate.models.UpdateFile; +import com.azure.iot.deviceupdate.models.UpdateOperation; +import java.util.List; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous DeviceUpdateClient type. */ +/** + * Initializes a new instance of the asynchronous DeviceUpdateClient type. + */ @ServiceClient(builder = DeviceUpdateClientBuilder.class, isAsync = true) public final class DeviceUpdateAsyncClient { @Generated @@ -28,7 +41,7 @@ public final class DeviceUpdateAsyncClient { /** * Initializes an instance of DeviceUpdateAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -38,74 +51,72 @@ public final class DeviceUpdateAsyncClient { /** * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search + * expression.
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     friendlyName: String (Optional)
+     *     isDeployable: Boolean (Optional)
+     *     updateType: String (Optional)
+     *     installedCriteria: String (Optional)
+     *     compatibility (Required): [
      *          (Required){
-     *             updateId (Required): {
-     *                 provider: String (Required)
-     *                 name: String (Required)
-     *                 version: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
      *             }
-     *             description: String (Optional)
-     *             friendlyName: String (Optional)
-     *             isDeployable: Boolean (Optional)
-     *             updateType: String (Optional)
-     *             installedCriteria: String (Optional)
-     *             compatibility (Required): [
-     *                  (Required){
-     *                     String: String (Required)
+     *         }
+     *     ]
+     *     instructions (Optional): {
+     *         steps (Required): [
+     *              (Required){
+     *                 type: String(inline/reference) (Optional)
+     *                 description: String (Optional)
+     *                 handler: String (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
      *                 }
-     *             ]
-     *             instructions (Optional): {
-     *                 steps (Required): [
-     *                      (Required){
-     *                         type: String(Inline/Reference) (Optional)
-     *                         description: String (Optional)
-     *                         handler: String (Optional)
-     *                         handlerProperties: Object (Optional)
-     *                         files (Optional): [
-     *                             String (Optional)
-     *                         ]
-     *                         updateId (Optional): (recursive schema, see updateId above)
-     *                     }
+     *                 files (Optional): [
+     *                     String (Optional)
      *                 ]
+     *                 updateId (Optional): (recursive schema, see updateId above)
      *             }
-     *             referencedBy (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *             scanResult: String (Optional)
-     *             manifestVersion: String (Required)
-     *             importedDateTime: OffsetDateTime (Required)
-     *             createdDateTime: OffsetDateTime (Required)
-     *             etag: String (Optional)
-     *         }
+     *         ]
+     *     }
+     *     referencedBy (Optional): [
+     *         (recursive schema, see above)
      *     ]
-     *     nextLink: String (Optional)
+     *     scanResult: String (Optional)
+     *     manifestVersion: String (Required)
+     *     importedDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -114,12 +125,12 @@ public PagedFlux listUpdates(RequestOptions requestOptions) { } /** - * Import new update version. This is a long-running-operation; use Operation-Location response header value to - * check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import new update version. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * [
      *      (Required){
      *         importManifest (Required): {
@@ -138,11 +149,13 @@ public PagedFlux listUpdates(RequestOptions requestOptions) {
      *         ]
      *     }
      * ]
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -156,16 +169,20 @@ public PagedFlux listUpdates(RequestOptions requestOptions) {
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -182,10 +199,12 @@ public PagedFlux listUpdates(RequestOptions requestOptions) {
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param updateToImport The update to be imported (see schema - * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for details). + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -202,20 +221,19 @@ public PollerFlux beginImportUpdate(BinaryData updateToI /** * Get a specific update version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -229,16 +247,20 @@ public PollerFlux beginImportUpdate(BinaryData updateToI
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -255,8 +277,9 @@ public PollerFlux beginImportUpdate(BinaryData updateToI
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -275,9 +298,9 @@ public Mono> getUpdateWithResponse(String provider, String } /** - * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value - * to check for operation status. - * + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -290,32 +313,29 @@ public Mono> getUpdateWithResponse(String provider, String */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginDeleteUpdate(String provider, String name, String version, + public PollerFlux beginDeleteUpdate(String provider, String name, String version, RequestOptions requestOptions) { return this.serviceClient.beginDeleteUpdateAsync(provider, name, version, requestOptions); } /** - * Get a list of all update providers that have been imported to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * Get a list of all update providers that have been imported to Device Update for
+     * IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update providers that have been imported to Device Update for IoT Hub as paginated response - * with {@link PagedFlux}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub as paginated response with {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -325,26 +345,22 @@ public PagedFlux listProviders(RequestOptions requestOptions) { /** * Get a list of all update names that match the specified provider. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param provider Update provider. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update names that match the specified provider as paginated response with {@link - * PagedFlux}. + * @return a list of all update names that match the specified provider as paginated response with + * {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -354,28 +370,21 @@ public PagedFlux listNames(String provider, RequestOptions requestOp /** * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param provider Update provider. * @param name Update name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -384,7 +393,7 @@ public PagedFlux listNames(String provider, RequestOptions requestOp * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all update versions that match the specified provider and name as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -394,18 +403,14 @@ public PagedFlux listVersions(String provider, String name, RequestO /** * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -414,8 +419,8 @@ public PagedFlux listVersions(String provider, String name, RequestO * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update file identifiers for the specified version as paginated response with {@link - * PagedFlux}. + * @return a list of all update file identifiers for the specified version as paginated response with + * {@link PagedFlux}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -426,20 +431,19 @@ public PagedFlux listFiles(String provider, String name, String vers /** * Get a specific update file from the version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     fileName: String (Required)
      *     sizeInBytes: long (Required)
@@ -450,7 +454,7 @@ public PagedFlux listFiles(String provider, String name, String vers
      *     scanResult: String (Optional)
      *     scanDetails: String (Optional)
      *     properties (Optional): {
-     *         String: String (Optional)
+     *         String: String (Required)
      *     }
      *     fileId: String (Required)
      *     relatedFiles (Optional): [
@@ -464,7 +468,7 @@ public PagedFlux listFiles(String provider, String name, String vers
      *             scanResult: String (Optional)
      *             scanDetails: String (Optional)
      *             properties (Optional): {
-     *                 String: String (Optional)
+     *                 String: String (Required)
      *             }
      *         }
      *     ]
@@ -473,8 +477,9 @@ public PagedFlux listFiles(String provider, String name, String vers
      *     }
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -484,8 +489,8 @@ public PagedFlux listFiles(String provider, String name, String vers * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specific update file from the version along with {@link Response} on successful completion of {@link - * Mono}. + * @return a specific update file from the version along with {@link Response} on successful completion of + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) @@ -495,63 +500,62 @@ public Mono> getFileWithResponse(String provider, String na } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one + * specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             operationId: String (Required)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             update (Optional): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             resourceLocation: String (Optional)
-     *             error (Optional): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Optional)
-     *                     errorDetail: String (Optional)
-     *                     innerError (Optional): (recursive schema, see innerError above)
-     *                 }
-     *                 occurredDateTime: OffsetDateTime (Optional)
-     *             }
-     *             traceId: String (Optional)
-     *             lastActionDateTime: OffsetDateTime (Required)
-     *             createdDateTime: OffsetDateTime (Required)
-     *             etag: String (Optional)
+     *     operationId: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
+     *     update (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     resourceLocation: String (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Required)
+     *             message: String (Optional)
+     *             errorDetail: String (Optional)
+     *             innerError (Optional): (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime (Optional)
+     *     }
+     *     traceId: String (Optional)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -567,20 +571,19 @@ public PagedFlux listOperationStatuses(RequestOptions requestOptions /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -614,8 +617,9 @@ public PagedFlux listOperationStatuses(RequestOptions requestOptions
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -630,4 +634,520 @@ public Mono> getOperationStatusWithResponse(String operatio RequestOptions requestOptions) { return this.serviceClient.getOperationStatusWithResponseAsync(operationId, requestOptions); } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + * @param search Request updates matching a free-text search expression. + * @param filter Optional to filter updates by isDeployable property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUpdates(String search, String filter) { + // Generated convenience method for listUpdates + RequestOptions requestOptions = new RequestOptions(); + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + PagedFlux pagedFluxResponse = listUpdates(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Update.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUpdates() { + // Generated convenience method for listUpdates + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listUpdates(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Update.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Import new update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param updateToImport The update to be imported (see schema + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of update metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportUpdate(List updateToImport) { + // Generated convenience method for beginImportUpdateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginImportUpdateWithModelAsync(BinaryData.fromObject(updateToImport), requestOptions); + } + + /** + * Get a specific update version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update version on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUpdate(String provider, String name, String version, String ifNoneMatch) { + // Generated convenience method for getUpdateWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getUpdateWithResponse(provider, name, version, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Update.class)); + } + + /** + * Get a specific update version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update version on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getUpdate(String provider, String name, String version) { + // Generated convenience method for getUpdateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUpdateWithResponse(provider, name, version, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Update.class)); + } + + /** + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteUpdate(String provider, String name, String version) { + // Generated convenience method for beginDeleteUpdateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteUpdateWithModelAsync(provider, name, version, requestOptions); + } + + /** + * Get a list of all update providers that have been imported to Device Update for + * IoT Hub. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProviders() { + // Generated convenience method for listProviders + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listProviders(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get a list of all update names that match the specified provider. + * + * @param provider Update provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update names that match the specified provider as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNames(String provider) { + // Generated convenience method for listNames + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listNames(provider, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get a list of all update versions that match the specified provider and name. + * + * @param provider Update provider. + * @param name Update name. + * @param filter Optional to filter updates by isDeployable property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersions(String provider, String name, String filter) { + // Generated convenience method for listVersions + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + PagedFlux pagedFluxResponse = listVersions(provider, name, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get a list of all update versions that match the specified provider and name. + * + * @param provider Update provider. + * @param name Update name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersions(String provider, String name) { + // Generated convenience method for listVersions + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listVersions(provider, name, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update file identifiers for the specified version as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listFiles(String provider, String name, String version) { + // Generated convenience method for listFiles + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listFiles(provider, name, version, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(String.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get a specific update file from the version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update file from the version on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getFile(String provider, String name, String version, String fileId, String ifNoneMatch) { + // Generated convenience method for getFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getFileWithResponse(provider, name, version, fileId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UpdateFile.class)); + } + + /** + * Get a specific update file from the version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update file from the version on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getFile(String provider, String name, String version, String fileId) { + // Generated convenience method for getFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFileWithResponse(provider, name, version, fileId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UpdateFile.class)); + } + + /** + * 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. + * + * @param filter Optional to filter operations by status property. Only one specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'". + * @param top Specifies a non-negative integer n that limits the number of items returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all import update operations as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationStatuses(String filter, Integer top) { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + PagedFlux pagedFluxResponse = listOperationStatuses(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * 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. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all import update operations as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationStatuses() { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listOperationStatuses(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOperationStatus(String operationId, String ifNoneMatch) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getOperationStatusWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class)); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOperationStatus(String operationId) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationStatusWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class)); + } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java index 1a78b7b9acab..4a36dcfb8fdd 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate; @@ -12,14 +12,22 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.polling.SyncPoller; import com.azure.iot.deviceupdate.implementation.DeviceUpdatesImpl; +import com.azure.iot.deviceupdate.models.ImportUpdateInputItem; +import com.azure.iot.deviceupdate.models.Update; +import com.azure.iot.deviceupdate.models.UpdateFile; +import com.azure.iot.deviceupdate.models.UpdateOperation; +import java.util.List; -/** Initializes a new instance of the synchronous DeviceUpdateClient type. */ +/** + * Initializes a new instance of the synchronous DeviceUpdateClient type. + */ @ServiceClient(builder = DeviceUpdateClientBuilder.class) public final class DeviceUpdateClient { @Generated @@ -27,7 +35,7 @@ public final class DeviceUpdateClient { /** * Initializes an instance of DeviceUpdateClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -37,74 +45,72 @@ public final class DeviceUpdateClient { /** * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search + * expression.
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     friendlyName: String (Optional)
+     *     isDeployable: Boolean (Optional)
+     *     updateType: String (Optional)
+     *     installedCriteria: String (Optional)
+     *     compatibility (Required): [
      *          (Required){
-     *             updateId (Required): {
-     *                 provider: String (Required)
-     *                 name: String (Required)
-     *                 version: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
      *             }
-     *             description: String (Optional)
-     *             friendlyName: String (Optional)
-     *             isDeployable: Boolean (Optional)
-     *             updateType: String (Optional)
-     *             installedCriteria: String (Optional)
-     *             compatibility (Required): [
-     *                  (Required){
-     *                     String: String (Required)
+     *         }
+     *     ]
+     *     instructions (Optional): {
+     *         steps (Required): [
+     *              (Required){
+     *                 type: String(inline/reference) (Optional)
+     *                 description: String (Optional)
+     *                 handler: String (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
      *                 }
-     *             ]
-     *             instructions (Optional): {
-     *                 steps (Required): [
-     *                      (Required){
-     *                         type: String(Inline/Reference) (Optional)
-     *                         description: String (Optional)
-     *                         handler: String (Optional)
-     *                         handlerProperties: Object (Optional)
-     *                         files (Optional): [
-     *                             String (Optional)
-     *                         ]
-     *                         updateId (Optional): (recursive schema, see updateId above)
-     *                     }
+     *                 files (Optional): [
+     *                     String (Optional)
      *                 ]
+     *                 updateId (Optional): (recursive schema, see updateId above)
      *             }
-     *             referencedBy (Optional): [
-     *                 (recursive schema, see above)
-     *             ]
-     *             scanResult: String (Optional)
-     *             manifestVersion: String (Required)
-     *             importedDateTime: OffsetDateTime (Required)
-     *             createdDateTime: OffsetDateTime (Required)
-     *             etag: String (Optional)
-     *         }
+     *         ]
+     *     }
+     *     referencedBy (Optional): [
+     *         (recursive schema, see above)
      *     ]
-     *     nextLink: String (Optional)
+     *     scanResult: String (Optional)
+     *     manifestVersion: String (Required)
+     *     importedDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -113,12 +119,12 @@ public PagedIterable listUpdates(RequestOptions requestOptions) { } /** - * Import new update version. This is a long-running-operation; use Operation-Location response header value to - * check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import new update version. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * [
      *      (Required){
      *         importManifest (Required): {
@@ -137,11 +143,13 @@ public PagedIterable listUpdates(RequestOptions requestOptions) {
      *         ]
      *     }
      * ]
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -155,16 +163,20 @@ public PagedIterable listUpdates(RequestOptions requestOptions) {
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -181,10 +193,12 @@ public PagedIterable listUpdates(RequestOptions requestOptions) {
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param updateToImport The update to be imported (see schema - * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for details). + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -201,20 +215,19 @@ public SyncPoller beginImportUpdate(BinaryData updateToI /** * Get a specific update version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -228,16 +241,20 @@ public SyncPoller beginImportUpdate(BinaryData updateToI
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -254,8 +271,9 @@ public SyncPoller beginImportUpdate(BinaryData updateToI
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -274,9 +292,9 @@ public Response getUpdateWithResponse(String provider, String name, } /** - * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value - * to check for operation status. - * + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -289,32 +307,29 @@ public Response getUpdateWithResponse(String provider, String name, */ @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginDeleteUpdate(String provider, String name, String version, + public SyncPoller beginDeleteUpdate(String provider, String name, String version, RequestOptions requestOptions) { return this.serviceClient.beginDeleteUpdate(provider, name, version, requestOptions); } /** - * Get a list of all update providers that have been imported to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * Get a list of all update providers that have been imported to Device Update for
+     * IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update providers that have been imported to Device Update for IoT Hub as paginated response - * with {@link PagedIterable}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub as paginated response with {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -324,26 +339,22 @@ public PagedIterable listProviders(RequestOptions requestOptions) { /** * Get a list of all update names that match the specified provider. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param provider Update provider. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update names that match the specified provider as paginated response with {@link - * PagedIterable}. + * @return a list of all update names that match the specified provider as paginated response with + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -353,28 +364,21 @@ public PagedIterable listNames(String provider, RequestOptions reque /** * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param provider Update provider. * @param name Update name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -383,7 +387,7 @@ public PagedIterable listNames(String provider, RequestOptions reque * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all update versions that match the specified provider and name as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -393,18 +397,14 @@ public PagedIterable listVersions(String provider, String name, Requ /** * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
+     * 

Response Body Schema

+ * + *
+     * {@code
+     * String
      * }
-     * }
- * + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -413,8 +413,8 @@ public PagedIterable listVersions(String provider, String name, Requ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update file identifiers for the specified version as paginated response with {@link - * PagedIterable}. + * @return a list of all update file identifiers for the specified version as paginated response with + * {@link PagedIterable}. */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) @@ -425,20 +425,19 @@ public PagedIterable listFiles(String provider, String name, String /** * Get a specific update file from the version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     fileName: String (Required)
      *     sizeInBytes: long (Required)
@@ -449,7 +448,7 @@ public PagedIterable listFiles(String provider, String name, String
      *     scanResult: String (Optional)
      *     scanDetails: String (Optional)
      *     properties (Optional): {
-     *         String: String (Optional)
+     *         String: String (Required)
      *     }
      *     fileId: String (Required)
      *     relatedFiles (Optional): [
@@ -463,7 +462,7 @@ public PagedIterable listFiles(String provider, String name, String
      *             scanResult: String (Optional)
      *             scanDetails: String (Optional)
      *             properties (Optional): {
-     *                 String: String (Optional)
+     *                 String: String (Required)
      *             }
      *         }
      *     ]
@@ -472,8 +471,9 @@ public PagedIterable listFiles(String provider, String name, String
      *     }
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -493,63 +493,62 @@ public Response getFileWithResponse(String provider, String name, St } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one + * specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             operationId: String (Required)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             update (Optional): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             resourceLocation: String (Optional)
-     *             error (Optional): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Optional)
-     *                     errorDetail: String (Optional)
-     *                     innerError (Optional): (recursive schema, see innerError above)
-     *                 }
-     *                 occurredDateTime: OffsetDateTime (Optional)
-     *             }
-     *             traceId: String (Optional)
-     *             lastActionDateTime: OffsetDateTime (Required)
-     *             createdDateTime: OffsetDateTime (Required)
-     *             etag: String (Optional)
+     *     operationId: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
+     *     update (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     resourceLocation: String (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Required)
+     *             message: String (Optional)
+     *             errorDetail: String (Optional)
+     *             innerError (Optional): (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime (Optional)
+     *     }
+     *     traceId: String (Optional)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -565,20 +564,19 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -612,8 +610,9 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -627,4 +626,415 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { return this.serviceClient.getOperationStatusWithResponse(operationId, requestOptions); } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + * @param search Request updates matching a free-text search expression. + * @param filter Optional to filter updates by isDeployable property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdates(String search, String filter) { + // Generated convenience method for listUpdates + RequestOptions requestOptions = new RequestOptions(); + if (search != null) { + requestOptions.addQueryParam("search", search, false); + } + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + return serviceClient.listUpdates(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Update.class)); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdates() { + // Generated convenience method for listUpdates + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listUpdates(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Update.class)); + } + + /** + * Import new update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param updateToImport The update to be imported (see schema + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of update metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportUpdate(List updateToImport) { + // Generated convenience method for beginImportUpdateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginImportUpdateWithModel(BinaryData.fromObject(updateToImport), requestOptions); + } + + /** + * Get a specific update version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update version. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Update getUpdate(String provider, String name, String version, String ifNoneMatch) { + // Generated convenience method for getUpdateWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getUpdateWithResponse(provider, name, version, requestOptions).getValue().toObject(Update.class); + } + + /** + * Get a specific update version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update version. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Update getUpdate(String provider, String name, String version) { + // Generated convenience method for getUpdateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getUpdateWithResponse(provider, name, version, requestOptions).getValue().toObject(Update.class); + } + + /** + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteUpdate(String provider, String name, String version) { + // Generated convenience method for beginDeleteUpdateWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginDeleteUpdateWithModel(provider, name, version, requestOptions); + } + + /** + * Get a list of all update providers that have been imported to Device Update for + * IoT Hub. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProviders() { + // Generated convenience method for listProviders + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listProviders(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class)); + } + + /** + * Get a list of all update names that match the specified provider. + * + * @param provider Update provider. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update names that match the specified provider as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNames(String provider) { + // Generated convenience method for listNames + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listNames(provider, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class)); + } + + /** + * Get a list of all update versions that match the specified provider and name. + * + * @param provider Update provider. + * @param name Update name. + * @param filter Optional to filter updates by isDeployable property. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String provider, String name, String filter) { + // Generated convenience method for listVersions + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + return serviceClient.listVersions(provider, name, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class)); + } + + /** + * Get a list of all update versions that match the specified provider and name. + * + * @param provider Update provider. + * @param name Update name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String provider, String name) { + // Generated convenience method for listVersions + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listVersions(provider, name, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class)); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all update file identifiers for the specified version as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listFiles(String provider, String name, String version) { + // Generated convenience method for listFiles + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listFiles(provider, name, version, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class)); + } + + /** + * Get a specific update file from the version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update file from the version. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateFile getFile(String provider, String name, String version, String fileId, String ifNoneMatch) { + // Generated convenience method for getFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getFileWithResponse(provider, name, version, fileId, requestOptions).getValue() + .toObject(UpdateFile.class); + } + + /** + * Get a specific update file from the version. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific update file from the version. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateFile getFile(String provider, String name, String version, String fileId) { + // Generated convenience method for getFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getFileWithResponse(provider, name, version, fileId, requestOptions).getValue() + .toObject(UpdateFile.class); + } + + /** + * 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. + * + * @param filter Optional to filter operations by status property. Only one specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'". + * @param top Specifies a non-negative integer n that limits the number of items returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all import update operations as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperationStatuses(String filter, Integer top) { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (top != null) { + requestOptions.addQueryParam("top", String.valueOf(top), false); + } + return serviceClient.listOperationStatuses(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(UpdateOperation.class)); + } + + /** + * 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. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of all import update operations as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperationStatuses() { + // Generated convenience method for listOperationStatuses + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listOperationStatuses(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(UpdateOperation.class)); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if + * the ETag on the server does not match this value. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateOperation getOperationStatus(String operationId, String ifNoneMatch) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (ifNoneMatch != null) { + requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return getOperationStatusWithResponse(operationId, requestOptions).getValue().toObject(UpdateOperation.class); + } + + /** + * Retrieve operation status. + * + * @param operationId Operation identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public UpdateOperation getOperationStatus(String operationId) { + // Generated convenience method for getOperationStatusWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOperationStatusWithResponse(operationId, requestOptions).getValue().toObject(UpdateOperation.class); + } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java index 1533650d2704..85037d533976 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate; @@ -20,7 +20,6 @@ import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -33,6 +32,7 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.iot.deviceupdate.implementation.DeviceUpdateClientImpl; import java.util.ArrayList; @@ -40,8 +40,15 @@ import java.util.Map; import java.util.Objects; -/** A builder for creating a new instance of the DeviceUpdateClient type. */ -@ServiceClientBuilder(serviceClients = { DeviceUpdateClient.class, DeviceUpdateAsyncClient.class }) +/** + * A builder for creating a new instance of the DeviceUpdateClient type. + */ +@ServiceClientBuilder( + serviceClients = { + DeviceUpdateClient.class, + DeviceManagementClient.class, + DeviceUpdateAsyncClient.class, + DeviceManagementAsyncClient.class }) public final class DeviceUpdateClientBuilder implements HttpTrait, ConfigurationTrait, TokenCredentialTrait, EndpointTrait { @@ -60,37 +67,46 @@ public final class DeviceUpdateClientBuilder @Generated private final List pipelinePolicies; - /** Create an instance of the DeviceUpdateClientBuilder. */ + /** + * Create an instance of the DeviceUpdateClientBuilder. + */ @Generated public DeviceUpdateClientBuilder() { this.pipelinePolicies = new ArrayList<>(); } /* - * The HTTP pipeline to send requests through. + * The HTTP client used to send the request. */ @Generated - private HttpPipeline pipeline; + private HttpClient httpClient; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override - public DeviceUpdateClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public DeviceUpdateClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP client used to send the request. + * The HTTP pipeline to send requests through. */ @Generated - private HttpClient httpClient; + private HttpPipeline pipeline; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override - public DeviceUpdateClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + public DeviceUpdateClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; return this; } @@ -100,7 +116,9 @@ public DeviceUpdateClientBuilder httpClient(HttpClient httpClient) { @Generated private HttpLogOptions httpLogOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @@ -114,7 +132,9 @@ public DeviceUpdateClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @Generated private ClientOptions clientOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder clientOptions(ClientOptions clientOptions) { @@ -128,7 +148,9 @@ public DeviceUpdateClientBuilder clientOptions(ClientOptions clientOptions) { @Generated private RetryOptions retryOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder retryOptions(RetryOptions retryOptions) { @@ -136,7 +158,9 @@ public DeviceUpdateClientBuilder retryOptions(RetryOptions retryOptions) { return this; } - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @@ -151,7 +175,9 @@ public DeviceUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @Generated private Configuration configuration; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder configuration(Configuration configuration) { @@ -165,7 +191,9 @@ public DeviceUpdateClientBuilder configuration(Configuration configuration) { @Generated private TokenCredential tokenCredential; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder credential(TokenCredential tokenCredential) { @@ -179,7 +207,9 @@ public DeviceUpdateClientBuilder credential(TokenCredential tokenCredential) { @Generated private String endpoint; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder endpoint(String endpoint) { @@ -195,7 +225,7 @@ public DeviceUpdateClientBuilder endpoint(String endpoint) { /** * Sets The Device Update for IoT Hub account instance identifier. - * + * * @param instanceId the instanceId value. * @return the DeviceUpdateClientBuilder. */ @@ -213,7 +243,7 @@ public DeviceUpdateClientBuilder instanceId(String instanceId) { /** * Sets Service version. - * + * * @param serviceVersion the serviceVersion value. * @return the DeviceUpdateClientBuilder. */ @@ -231,7 +261,7 @@ public DeviceUpdateClientBuilder serviceVersion(DeviceUpdateServiceVersion servi /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the DeviceUpdateClientBuilder. */ @@ -243,19 +273,28 @@ public DeviceUpdateClientBuilder retryPolicy(RetryPolicy retryPolicy) { /** * Builds an instance of DeviceUpdateClientImpl with the provided parameters. - * + * * @return an instance of DeviceUpdateClientImpl. */ @Generated private DeviceUpdateClientImpl buildInnerClient() { + this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); DeviceUpdateServiceVersion localServiceVersion = (serviceVersion != null) ? serviceVersion : DeviceUpdateServiceVersion.getLatest(); DeviceUpdateClientImpl client = new DeviceUpdateClientImpl(localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, instanceId, localServiceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, this.instanceId, localServiceVersion); return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + Objects.requireNonNull(instanceId, "'instanceId' cannot be null."); + } + @Generated private HttpPipeline createHttpPipeline() { Configuration buildConfiguration @@ -269,9 +308,8 @@ private HttpPipeline createHttpPipeline() { policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); policies.add(new RequestIdPolicy()); policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); - if (headers.getSize() > 0) { + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { policies.add(new AddHeadersPolicy(headers)); } this.pipelinePolicies.stream() @@ -280,7 +318,6 @@ private HttpPipeline createHttpPipeline() { HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); } @@ -288,7 +325,7 @@ private HttpPipeline createHttpPipeline() { .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .clientOptions(localClientOptions) @@ -298,21 +335,43 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of DeviceUpdateAsyncClient class. - * + * * @return an instance of DeviceUpdateAsyncClient. */ @Generated - public DeviceUpdateAsyncClient buildAsyncClient() { + public DeviceUpdateAsyncClient buildDeviceUpdateAsyncClient() { return new DeviceUpdateAsyncClient(buildInnerClient().getDeviceUpdates()); } + /** + * Builds an instance of DeviceManagementAsyncClient class. + * + * @return an instance of DeviceManagementAsyncClient. + */ + @Generated + public DeviceManagementAsyncClient buildDeviceManagementAsyncClient() { + return new DeviceManagementAsyncClient(buildInnerClient().getDeviceManagements()); + } + /** * Builds an instance of DeviceUpdateClient class. - * + * * @return an instance of DeviceUpdateClient. */ @Generated - public DeviceUpdateClient buildClient() { + public DeviceUpdateClient buildDeviceUpdateClient() { return new DeviceUpdateClient(buildInnerClient().getDeviceUpdates()); } + + /** + * Builds an instance of DeviceManagementClient class. + * + * @return an instance of DeviceManagementClient. + */ + @Generated + public DeviceManagementClient buildDeviceManagementClient() { + return new DeviceManagementClient(buildInnerClient().getDeviceManagements()); + } + + private static final ClientLogger LOGGER = new ClientLogger(DeviceUpdateClientBuilder.class); } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java index 9f460f54d617..64a94b9749e8 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java @@ -1,15 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate; import com.azure.core.util.ServiceVersion; -/** Service version of DeviceUpdate. */ +/** + * Service version of DeviceUpdateClient. + */ public enum DeviceUpdateServiceVersion implements ServiceVersion { - /** Enum value 2022-10-01. */ - V2022_10_01("2022-10-01"); + /** + * Enum value 2022-10-01. + */ + V2022_10_01("2022-10-01"), + + /** + * Enum value 2026-06-01. + */ + V2026_06_01("2026-06-01"); private final String version; @@ -17,7 +26,9 @@ public enum DeviceUpdateServiceVersion implements ServiceVersion { this.version = version; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public String getVersion() { return this.version; @@ -25,10 +36,10 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. - * + * * @return The latest {@link DeviceUpdateServiceVersion}. */ public static DeviceUpdateServiceVersion getLatest() { - return V2022_10_01; + return V2026_06_01; } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java index d103cbc76d70..18b395eaf0f3 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.implementation; @@ -34,28 +34,37 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.PollingStrategyOptions; import com.azure.core.util.polling.SyncDefaultPollingStrategy; import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.TypeReference; +import com.azure.iot.deviceupdate.DeviceUpdateServiceVersion; +import com.azure.iot.deviceupdate.models.DeviceOperation; import java.time.Duration; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DeviceManagements. */ +/** + * An instance of this class provides access to all the operations defined in DeviceManagements. + */ public final class DeviceManagementsImpl { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DeviceManagementsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DeviceUpdateClientImpl client; /** * Initializes an instance of DeviceManagementsImpl. - * + * * @param client the instance of the service client containing this operation class. */ DeviceManagementsImpl(DeviceUpdateClientImpl client) { @@ -64,12 +73,21 @@ public final class DeviceManagementsImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public DeviceUpdateServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + /** * The interface defining all the services for DeviceUpdateClientDeviceManagements to be used by the proxy service * to perform REST calls. */ @Host("https://{endpoint}") - @ServiceInterface(name = "DeviceUpdateClientDe") + @ServiceInterface(name = "DeviceUpdateClientDeviceManagements") public interface DeviceManagementsService { @Get("/deviceUpdate/{instanceId}/management/deviceClasses") @ExpectedResponses({ 200 }) @@ -78,9 +96,8 @@ public interface DeviceManagementsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDeviceClasses(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceClasses") @ExpectedResponses({ 200 }) @@ -89,9 +106,8 @@ Mono> listDeviceClasses(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDeviceClassesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({ 200 }) @@ -100,9 +116,9 @@ Response listDeviceClassesSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeviceClass(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({ 200 }) @@ -111,9 +127,9 @@ Mono> getDeviceClass(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeviceClassSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Patch("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({ 200 }) @@ -122,10 +138,11 @@ Response getDeviceClassSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> updateDeviceClass(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData deviceClassPatch, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData deviceClassPatch, RequestOptions requestOptions, + Context context); @Patch("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({ 200 }) @@ -134,10 +151,11 @@ Mono> updateDeviceClass(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response updateDeviceClassSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/merge-patch+json") BinaryData deviceClassPatch, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData deviceClassPatch, RequestOptions requestOptions, + Context context); @Delete("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({ 204 }) @@ -146,9 +164,8 @@ Response updateDeviceClassSync(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteDeviceClass(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, RequestOptions requestOptions, Context context); @Delete("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({ 204 }) @@ -157,9 +174,8 @@ Mono> deleteDeviceClass(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteDeviceClassSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") @ExpectedResponses({ 200 }) @@ -168,9 +184,9 @@ Response deleteDeviceClassSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listInstallableUpdatesForDeviceClass(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") @ExpectedResponses({ 200 }) @@ -179,9 +195,9 @@ Mono> listInstallableUpdatesForDeviceClass(@HostParam("endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listInstallableUpdatesForDeviceClassSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/devices") @ExpectedResponses({ 200 }) @@ -190,9 +206,8 @@ Response listInstallableUpdatesForDeviceClassSync(@HostParam("endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDevices(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/devices") @ExpectedResponses({ 200 }) @@ -201,9 +216,8 @@ Mono> listDevices(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDevicesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/management/devices:import") @ExpectedResponses({ 202 }) @@ -212,9 +226,9 @@ Response listDevicesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> importDevices(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData importType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData importType, + RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/management/devices:import") @ExpectedResponses({ 202 }) @@ -223,9 +237,9 @@ Mono> importDevices(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response importDevicesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData importType, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData importType, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}") @ExpectedResponses({ 200 }) @@ -234,9 +248,9 @@ Response importDevicesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDevice(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("deviceId") String deviceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceId") String deviceId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}") @ExpectedResponses({ 200 }) @@ -245,9 +259,9 @@ Mono> getDevice(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeviceSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("deviceId") String deviceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceId") String deviceId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") @ExpectedResponses({ 200 }) @@ -256,8 +270,8 @@ Response getDeviceSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeviceModule(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("deviceId") String deviceId, - @PathParam("moduleId") String moduleId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceId") String deviceId, @PathParam("moduleId") String moduleId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") @@ -267,8 +281,8 @@ Mono> getDeviceModule(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeviceModuleSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("deviceId") String deviceId, - @PathParam("moduleId") String moduleId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("deviceId") String deviceId, @PathParam("moduleId") String moduleId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/updateCompliance") @@ -278,9 +292,8 @@ Response getDeviceModuleSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getUpdateCompliance(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/updateCompliance") @ExpectedResponses({ 200 }) @@ -289,9 +302,8 @@ Mono> getUpdateCompliance(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getUpdateComplianceSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups") @ExpectedResponses({ 200 }) @@ -300,9 +312,8 @@ Response getUpdateComplianceSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listGroups(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups") @ExpectedResponses({ 200 }) @@ -311,9 +322,8 @@ Mono> listGroups(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listGroupsSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") @ExpectedResponses({ 200 }) @@ -322,9 +332,9 @@ Response listGroupsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getGroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") @ExpectedResponses({ 200 }) @@ -333,9 +343,9 @@ Mono> getGroup(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getGroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}") @ExpectedResponses({ 204 }) @@ -344,9 +354,8 @@ Response getGroupSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteGroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, RequestOptions requestOptions, Context context); @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}") @ExpectedResponses({ 204 }) @@ -355,9 +364,8 @@ Mono> deleteGroup(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteGroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") @ExpectedResponses({ 200 }) @@ -366,9 +374,9 @@ Response deleteGroupSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getUpdateComplianceForGroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") @ExpectedResponses({ 200 }) @@ -377,9 +385,9 @@ Mono> getUpdateComplianceForGroup(@HostParam("endpoint") St @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getUpdateComplianceForGroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") @ExpectedResponses({ 200 }) @@ -388,9 +396,9 @@ Response getUpdateComplianceForGroupSync(@HostParam("endpoint") Stri @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listBestUpdatesForGroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") @ExpectedResponses({ 200 }) @@ -399,9 +407,9 @@ Mono> listBestUpdatesForGroup(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listBestUpdatesForGroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") @ExpectedResponses({ 200 }) @@ -410,9 +418,9 @@ Response listBestUpdatesForGroupSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDeploymentsForGroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") @ExpectedResponses({ 200 }) @@ -421,9 +429,9 @@ Mono> listDeploymentsForGroup(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDeploymentsForGroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @ExpectedResponses({ 200 }) @@ -432,8 +440,8 @@ Response listDeploymentsForGroupSync(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeployment(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @@ -443,8 +451,8 @@ Mono> getDeployment(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeploymentSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @@ -454,10 +462,10 @@ Response getDeploymentSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createOrUpdateDeployment(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData deployment, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData deployment, RequestOptions requestOptions, Context context); @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @ExpectedResponses({ 200 }) @@ -466,32 +474,10 @@ Mono> createOrUpdateDeployment(@HostParam("endpoint") Strin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createOrUpdateDeploymentSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData deployment, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteDeployment(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteDeploymentSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData deployment, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") @ExpectedResponses({ 200 }) @@ -500,8 +486,8 @@ Response deleteDeploymentSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeploymentStatus(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") @@ -511,8 +497,8 @@ Mono> getDeploymentStatus(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeploymentStatusSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups") @@ -522,9 +508,9 @@ Response getDeploymentStatusSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDeviceClassSubgroupsForGroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups") @ExpectedResponses({ 200 }) @@ -533,9 +519,9 @@ Mono> listDeviceClassSubgroupsForGroup(@HostParam("endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDeviceClassSubgroupsForGroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") @ExpectedResponses({ 200 }) @@ -544,8 +530,8 @@ Response listDeviceClassSubgroupsForGroupSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeviceClassSubgroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") @@ -555,8 +541,8 @@ Mono> getDeviceClassSubgroup(@HostParam("endpoint") String @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeviceClassSubgroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") @@ -566,9 +552,9 @@ Response getDeviceClassSubgroupSync(@HostParam("endpoint") String en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteDeviceClassSubgroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + RequestOptions requestOptions, Context context); @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") @ExpectedResponses({ 204 }) @@ -577,9 +563,9 @@ Mono> deleteDeviceClassSubgroup(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteDeviceClassSubgroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance") @ExpectedResponses({ 200 }) @@ -588,8 +574,8 @@ Response deleteDeviceClassSubgroupSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeviceClassSubgroupUpdateCompliance(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance") @@ -599,8 +585,8 @@ Mono> getDeviceClassSubgroupUpdateCompliance(@HostParam("en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeviceClassSubgroupUpdateComplianceSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates") @@ -610,8 +596,8 @@ Response getDeviceClassSubgroupUpdateComplianceSync(@HostParam("endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getBestUpdatesForDeviceClassSubgroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates") @@ -621,8 +607,8 @@ Mono> getBestUpdatesForDeviceClassSubgroup(@HostParam("endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getBestUpdatesForDeviceClassSubgroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments") @@ -632,8 +618,8 @@ Response getBestUpdatesForDeviceClassSubgroupSync(@HostParam("endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDeploymentsForDeviceClassSubgroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments") @@ -643,8 +629,8 @@ Mono> listDeploymentsForDeviceClassSubgroup(@HostParam("end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDeploymentsForDeviceClassSubgroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") @@ -654,9 +640,9 @@ Response listDeploymentsForDeviceClassSubgroupSync(@HostParam("endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeploymentForDeviceClassSubgroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") @@ -666,33 +652,9 @@ Mono> getDeploymentForDeviceClassSubgroup(@HostParam("endpo @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeploymentForDeviceClassSubgroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteDeploymentForDeviceClassSubgroup(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteDeploymentForDeviceClassSubgroupSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:cancel") @@ -702,9 +664,9 @@ Response deleteDeploymentForDeviceClassSubgroupSync(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> stopDeployment(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:cancel") @@ -714,9 +676,9 @@ Mono> stopDeployment(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response stopDeploymentSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:retry") @@ -726,9 +688,9 @@ Response stopDeploymentSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> retryDeployment(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:retry") @@ -738,9 +700,9 @@ Mono> retryDeployment(@HostParam("endpoint") String endpoin @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response retryDeploymentSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/status") @@ -750,9 +712,9 @@ Response retryDeploymentSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getDeviceClassSubgroupDeploymentStatus(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/status") @@ -762,9 +724,9 @@ Mono> getDeviceClassSubgroupDeploymentStatus(@HostParam("en @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getDeviceClassSubgroupDeploymentStatusSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("groupId") String groupId, - @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/devicestates") @@ -774,9 +736,9 @@ Response getDeviceClassSubgroupDeploymentStatusSync(@HostParam("endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listDeviceStatesForDeviceClassSubgroupDeployment( - @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("instanceId") String instanceId, @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/devicestates") @@ -786,9 +748,9 @@ Mono> listDeviceStatesForDeviceClassSubgroupDeployment( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listDeviceStatesForDeviceClassSubgroupDeploymentSync( - @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, - @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("instanceId") String instanceId, @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, @PathParam("deploymentId") String deploymentId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/operations/{operationId}") @@ -798,9 +760,9 @@ Response listDeviceStatesForDeviceClassSubgroupDeploymentSync( @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getOperationStatus(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/operations/{operationId}") @ExpectedResponses({ 200 }) @@ -809,9 +771,9 @@ Mono> getOperationStatus(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getOperationStatusSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/operations") @ExpectedResponses({ 200 }) @@ -820,9 +782,8 @@ Response getOperationStatusSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listOperationStatuses(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/operations") @ExpectedResponses({ 200 }) @@ -831,9 +792,8 @@ Mono> listOperationStatuses(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listOperationStatusesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") @ExpectedResponses({ 201 }) @@ -842,9 +802,9 @@ Response listOperationStatusesSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> startLogCollection(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData logCollection, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String logCollectionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData logCollection, RequestOptions requestOptions, Context context); @Put("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") @@ -854,9 +814,9 @@ Mono> startLogCollection(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response startLogCollectionSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData logCollection, @HeaderParam("Accept") String accept, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String logCollectionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData logCollection, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") @@ -866,9 +826,9 @@ Response startLogCollectionSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLogCollection(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String logCollectionId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") @ExpectedResponses({ 200 }) @@ -877,9 +837,9 @@ Mono> getLogCollection(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLogCollectionSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String logCollectionId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections") @ExpectedResponses({ 200 }) @@ -888,9 +848,8 @@ Response getLogCollectionSync(@HostParam("endpoint") String endpoint @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listLogCollections(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections") @ExpectedResponses({ 200 }) @@ -899,9 +858,8 @@ Mono> listLogCollections(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listLogCollectionsSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus") @ExpectedResponses({ 200 }) @@ -910,9 +868,9 @@ Response listLogCollectionsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getLogCollectionDetailedStatus(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String logCollectionId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus") @ExpectedResponses({ 200 }) @@ -921,9 +879,9 @@ Mono> getLogCollectionDetailedStatus(@HostParam("endpoint") @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getLogCollectionDetailedStatusSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String logCollectionId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/deviceHealth") @ExpectedResponses({ 200 }) @@ -932,9 +890,9 @@ Response getLogCollectionDetailedStatusSync(@HostParam("endpoint") S @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listHealthOfDevices(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @QueryParam("filter") String filter, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @QueryParam("filter") String filter, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/deviceHealth") @ExpectedResponses({ 200 }) @@ -943,9 +901,53 @@ Mono> listHealthOfDevices(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listHealthOfDevicesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @QueryParam("filter") String filter, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @QueryParam("filter") String filter, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDeployment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, + RequestOptions requestOptions, Context context); + + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDeploymentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deploymentId") String deploymentId, + RequestOptions requestOptions, Context context); + + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDeploymentForDeviceClassSubgroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, RequestOptions requestOptions, Context context); + + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDeploymentForDeviceClassSubgroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("groupId") String groupId, @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -1189,23 +1191,22 @@ Response listHealthOfDevicesNextSync(@PathParam(value = "nextLink", } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on friendly name.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on + * friendly name.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1228,45 +1229,45 @@ Response listHealthOfDevicesNextSync(@PathParam(value = "nextLink",
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return 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 along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceClassesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeviceClasses(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + return FluxUtil.withContext(context -> service.listDeviceClasses(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on friendly name.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on + * friendly name.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1289,16 +1290,18 @@ private Mono> listDeviceClassesSinglePageAsync(Request
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 as paginated response with {@link PagedFlux}. + * @return 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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listDeviceClassesAsync(RequestOptions requestOptions) { @@ -1310,23 +1313,22 @@ public PagedFlux listDeviceClassesAsync(RequestOptions requestOption } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on friendly name.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on + * friendly name.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1349,44 +1351,46 @@ public PagedFlux listDeviceClassesAsync(RequestOptions requestOption
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link PagedResponse}. + * @return 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 along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDeviceClassesSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listDeviceClassesSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res + = service.listDeviceClassesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on friendly name.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device classes returned. You can filter on + * friendly name.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1409,16 +1413,18 @@ private PagedResponse listDeviceClassesSinglePage(RequestOptions req
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 as paginated response with {@link PagedIterable}. + * @return 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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceClasses(RequestOptions requestOptions) { @@ -1431,10 +1437,10 @@ public PagedIterable listDeviceClasses(RequestOptions requestOptions /** * Gets the properties of a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1457,8 +1463,9 @@ public PagedIterable listDeviceClasses(RequestOptions requestOptions
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1471,17 +1478,17 @@ public PagedIterable listDeviceClasses(RequestOptions requestOptions public Mono> getDeviceClassWithResponseAsync(String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDeviceClass(this.client.getEndpoint(), this.client.getInstanceId(), - deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getDeviceClass(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceClassId, accept, requestOptions, context)); } /** * Gets the properties of a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1504,8 +1511,9 @@ public Mono> getDeviceClassWithResponseAsync(String deviceC
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1517,24 +1525,26 @@ public Mono> getDeviceClassWithResponseAsync(String deviceC @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDeviceClassSync(this.client.getEndpoint(), this.client.getInstanceId(), deviceClassId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getDeviceClassSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceClassId, accept, requestOptions, Context.NONE); } /** * Update device class details. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
-     *     friendlyName: String (Required)
+     *     friendlyName: String (Optional, Required on create)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1557,10 +1567,12 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. - * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching + * friendlyName. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1571,26 +1583,29 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateDeviceClassWithResponseAsync(String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.updateDeviceClass(this.client.getEndpoint(), this.client.getInstanceId(), deviceClassId, - this.client.getServiceVersion().getVersion(), deviceClassPatch, accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.updateDeviceClass(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), deviceClassId, contentType, + accept, deviceClassPatch, requestOptions, context)); } /** * Update device class details. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
-     *     friendlyName: String (Required)
+     *     friendlyName: String (Optional, Required on create)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -1613,10 +1628,12 @@ public Mono> updateDeviceClassWithResponseAsync(String devi
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. - * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching + * friendlyName. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1627,18 +1644,22 @@ public Mono> updateDeviceClassWithResponseAsync(String devi @ServiceMethod(returns = ReturnType.SINGLE) public Response updateDeviceClassWithResponse(String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; final String accept = "application/json"; - return service.updateDeviceClassSync(this.client.getEndpoint(), this.client.getInstanceId(), deviceClassId, - this.client.getServiceVersion().getVersion(), deviceClassPatch, accept, requestOptions, Context.NONE); + return service.updateDeviceClassSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceClassId, contentType, accept, deviceClassPatch, requestOptions, + Context.NONE); } /** - * Deletes a device class. Device classes are created automatically when Device Update-enabled devices are connected - * to the hub but are not automatically cleaned up since they are referenced by DeviceClassSubgroups. If the user - * has deleted all DeviceClassSubgroups for a device class they can also delete the device class to remove the - * records from the system and to stop checking the compatibility of this device class with new updates. If a device - * is ever reconnected for this device class it will be re-created. - * + * Deletes a device class. Device classes are created automatically when Device + * Update-enabled devices are connected to the hub but are not automatically + * cleaned up since they are referenced by DeviceClassSubgroups. If the user has + * deleted all DeviceClassSubgroups for a device class they can also delete the + * device class to remove the records from the system and to stop checking the + * compatibility of this device class with new updates. If a device is ever + * reconnected for this device class it will be re-created. + * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1650,19 +1671,20 @@ public Response updateDeviceClassWithResponse(String deviceClassId, @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteDeviceClassWithResponseAsync(String deviceClassId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteDeviceClass(this.client.getEndpoint(), this.client.getInstanceId(), - deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteDeviceClass(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), deviceClassId, requestOptions, + context)); } /** - * Deletes a device class. Device classes are created automatically when Device Update-enabled devices are connected - * to the hub but are not automatically cleaned up since they are referenced by DeviceClassSubgroups. If the user - * has deleted all DeviceClassSubgroups for a device class they can also delete the device class to remove the - * records from the system and to stop checking the compatibility of this device class with new updates. If a device - * is ever reconnected for this device class it will be re-created. - * + * Deletes a device class. Device classes are created automatically when Device + * Update-enabled devices are connected to the hub but are not automatically + * cleaned up since they are referenced by DeviceClassSubgroups. If the user has + * deleted all DeviceClassSubgroups for a device class they can also delete the + * device class to remove the records from the system and to stop checking the + * compatibility of this device class with new updates. If a device is ever + * reconnected for this device class it will be re-created. + * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1673,17 +1695,16 @@ public Mono> deleteDeviceClassWithResponseAsync(String deviceClas */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteDeviceClassSync(this.client.getEndpoint(), this.client.getInstanceId(), deviceClassId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.deleteDeviceClassSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceClassId, requestOptions, Context.NONE); } /** * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -1693,8 +1714,9 @@ public Response deleteDeviceClassWithResponse(String deviceClassId, Reques
      *     description: String (Optional)
      *     friendlyName: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1702,7 +1724,7 @@ public Response deleteDeviceClassWithResponse(String deviceClassId, Reques * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of installable updates for a device class along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInstallableUpdatesForDeviceClassSinglePageAsync(String deviceClassId, @@ -1710,7 +1732,7 @@ private Mono> listInstallableUpdatesForDeviceClassSing final String accept = "application/json"; return FluxUtil .withContext(context -> service.listInstallableUpdatesForDeviceClass(this.client.getEndpoint(), - this.client.getInstanceId(), deviceClassId, this.client.getServiceVersion().getVersion(), accept, + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), deviceClassId, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); @@ -1718,10 +1740,10 @@ private Mono> listInstallableUpdatesForDeviceClassSing /** * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -1731,8 +1753,9 @@ private Mono> listInstallableUpdatesForDeviceClassSing
      *     description: String (Optional)
      *     friendlyName: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1753,10 +1776,10 @@ public PagedFlux listInstallableUpdatesForDeviceClassAsync(String de /** * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -1766,8 +1789,9 @@ public PagedFlux listInstallableUpdatesForDeviceClassAsync(String de
      *     description: String (Optional)
      *     friendlyName: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1780,19 +1804,19 @@ public PagedFlux listInstallableUpdatesForDeviceClassAsync(String de private PagedResponse listInstallableUpdatesForDeviceClassSinglePage(String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; - Response res - = service.listInstallableUpdatesForDeviceClassSync(this.client.getEndpoint(), this.client.getInstanceId(), - deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res = service.listInstallableUpdatesForDeviceClassSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), deviceClassId, accept, + requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -1802,8 +1826,9 @@ private PagedResponse listInstallableUpdatesForDeviceClassSinglePage
      *     description: String (Optional)
      *     friendlyName: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1824,20 +1849,20 @@ public PagedIterable listInstallableUpdatesForDeviceClass(String dev /** * Gets a list of devices connected to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to query for devices with no deployment status (that have never been deployed to).
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on + * GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to).
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -1871,42 +1896,44 @@ public PagedIterable listInstallableUpdatesForDeviceClass(String dev
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of devices connected to Device Update for IoT Hub along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDevicesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDevices(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext( + context -> service.listDevices(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Gets a list of devices connected to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to query for devices with no deployment status (that have never been deployed to).
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on + * GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to).
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -1940,8 +1967,9 @@ private Mono> listDevicesSinglePageAsync(RequestOption
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1960,20 +1988,20 @@ public PagedFlux listDevicesAsync(RequestOptions requestOptions) { /** * Gets a list of devices connected to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to query for devices with no deployment status (that have never been deployed to).
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on + * GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to).
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -2007,8 +2035,9 @@ public PagedFlux listDevicesAsync(RequestOptions requestOptions) {
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2019,28 +2048,29 @@ public PagedFlux listDevicesAsync(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDevicesSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listDevicesSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res + = service.listDevicesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Gets a list of devices connected to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to query for devices with no deployment status (that have never been deployed to).
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on + * GroupId, + * DeviceClassId, or GroupId and DeploymentStatus. Use DeploymentStatus eq null to + * query for devices with no deployment status (that have never been deployed to).
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -2074,15 +2104,16 @@ private PagedResponse listDevicesSinglePage(RequestOptions requestOp
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of devices connected to Device Update for IoT Hub as paginated response with {@link - * PagedIterable}. + * @return a list of devices connected to Device Update for IoT Hub as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDevices(RequestOptions requestOptions) { @@ -2094,15 +2125,16 @@ public PagedIterable listDevices(RequestOptions requestOptions) { } /** - * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header - * value to check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import existing devices from IoT Hub. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * String(Devices/Modules/All)
-     * }
- * + * } + *
+ * * @param importType The types of devices to import. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2113,22 +2145,23 @@ public PagedIterable listDevices(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> importDevicesWithResponseAsync(BinaryData importType, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.importDevices(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), importType, accept, requestOptions, context)); + final String contentType = "application/json"; + return FluxUtil.withContext( + context -> service.importDevices(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), contentType, importType, requestOptions, context)); } /** - * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header - * value to check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import existing devices from IoT Hub. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * String(Devices/Modules/All)
-     * }
- * + * } + *
+ * * @param importType The types of devices to import. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2139,21 +2172,88 @@ private Mono> importDevicesWithResponseAsync(BinaryData importTyp */ @ServiceMethod(returns = ReturnType.SINGLE) private Response importDevicesWithResponse(BinaryData importType, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.importDevicesSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), importType, accept, requestOptions, Context.NONE); + final String contentType = "application/json"; + return service.importDevicesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), contentType, importType, requestOptions, Context.NONE); } /** - * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header - * value to check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import existing devices from IoT Hub. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * String(Devices/Modules/All)
-     * }
- * + * } + *
+ * + * @param importType The types of devices to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportDevicesWithModelAsync(BinaryData importType, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.importDevicesWithResponseAsync(importType, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(DeviceOperation.class), TypeReference.createInstance(Void.class)); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + *

Request Body Schema

+ * + *
+     * {@code
+     * String(Devices/Modules/All)
+     * }
+     * 
+ * + * @param importType The types of devices to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportDevicesWithModel(BinaryData importType, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.importDevicesWithResponse(importType, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(DeviceOperation.class), TypeReference.createInstance(Void.class)); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + *

Request Body Schema

+ * + *
+     * {@code
+     * String(Devices/Modules/All)
+     * }
+     * 
+ * * @param importType The types of devices to import. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2167,24 +2267,26 @@ public PollerFlux beginImportDevicesAsync(BinaryData imp RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), () -> this.importDevicesWithResponseAsync(importType, requestOptions), - new OperationResourcePollingStrategyWithEndpoint<>(this.client.getHttpPipeline(), - "https://" + this.client.getEndpoint(), null, null, - requestOptions != null && requestOptions.getContext() != null + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() - : Context.NONE), + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** - * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header - * value to check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import existing devices from IoT Hub. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * String(Devices/Modules/All)
-     * }
- * + * } + *
+ * * @param importType The types of devices to import. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2201,16 +2303,18 @@ public SyncPoller beginImportDevices(BinaryData importTy .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() - : Context.NONE)), + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** - * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device properties and latest deployment status for a device connected
+     * to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -2244,30 +2348,33 @@ public SyncPoller beginImportDevices(BinaryData importTy
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub - * along with {@link Response} on successful completion of {@link Mono}. + * @return the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeviceWithResponseAsync(String deviceId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getDevice(this.client.getEndpoint(), this.client.getInstanceId(), - deviceId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getDevice(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceId, accept, requestOptions, context)); } /** - * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device properties and latest deployment status for a device connected
+     * to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -2301,31 +2408,32 @@ public Mono> getDeviceWithResponseAsync(String deviceId, Re
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub - * along with {@link Response}. + * @return the device properties and latest deployment status for a device connected + * to Device Update for IoT Hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDeviceSync(this.client.getEndpoint(), this.client.getInstanceId(), deviceId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getDeviceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceId, accept, requestOptions, Context.NONE); } /** - * Gets the device module properties and latest deployment status for a device module connected to Device Update for - * IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device module properties and latest deployment status for a device
+     * module connected to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -2359,8 +2467,9 @@ public Response getDeviceWithResponse(String deviceId, RequestOption
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param moduleId Device module identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -2368,25 +2477,26 @@ public Response getDeviceWithResponse(String deviceId, RequestOption * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device module properties and latest deployment status for a device module connected to Device Update - * for IoT Hub along with {@link Response} on successful completion of {@link Mono}. + * @return the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeviceModuleWithResponseAsync(String deviceId, String moduleId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDeviceModule(this.client.getEndpoint(), this.client.getInstanceId(), - deviceId, moduleId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getDeviceModule(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceId, moduleId, accept, requestOptions, context)); } /** - * Gets the device module properties and latest deployment status for a device module connected to Device Update for - * IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Gets the device module properties and latest deployment status for a device
+     * module connected to Device Update for IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -2420,8 +2530,9 @@ public Mono> getDeviceModuleWithResponseAsync(String device
      *         ]
      *     }
      * }
-     * }
- * + * } + *
+ * * @param deviceId Device identifier in Azure IoT Hub. * @param moduleId Device module identifier in Azure IoT Hub. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -2429,94 +2540,98 @@ public Mono> getDeviceModuleWithResponseAsync(String device * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device module properties and latest deployment status for a device module connected to Device Update - * for IoT Hub along with {@link Response}. + * @return the device module properties and latest deployment status for a device + * module connected to Device Update for IoT Hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceModuleWithResponse(String deviceId, String moduleId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDeviceModuleSync(this.client.getEndpoint(), this.client.getInstanceId(), deviceId, moduleId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getDeviceModuleSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), deviceId, moduleId, accept, requestOptions, Context.NONE); } /** - * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress - * receiving new updates. - * - *

Response Body Schema - * - *

{@code
+     * Gets the breakdown of how many devices are on their latest update, have new
+     * updates available, or are in progress receiving new updates.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the breakdown of how many devices are on their latest update, have new updates available, or are in - * progress receiving new updates along with {@link Response} on successful completion of {@link Mono}. + * @return the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUpdateComplianceWithResponseAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getUpdateCompliance(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getUpdateCompliance(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), accept, requestOptions, + context)); } /** - * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress - * receiving new updates. - * - *

Response Body Schema - * - *

{@code
+     * Gets the breakdown of how many devices are on their latest update, have new
+     * updates available, or are in progress receiving new updates.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the breakdown of how many devices are on their latest update, have new updates available, or are in - * progress receiving new updates along with {@link Response}. + * @return the breakdown of how many devices are on their latest update, have new + * updates available, or are in progress receiving new updates along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getUpdateComplianceWithResponse(RequestOptions requestOptions) { final String accept = "application/json"; - return service.getUpdateComplianceSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getUpdateComplianceSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); } /** - * Gets a list of all device groups. The $default group will always be returned first. - * - *

Query Parameters - * + * Gets a list of all device groups. The $default group will always be returned + * first. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, + * deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -2529,8 +2644,9 @@ public Response getUpdateComplianceWithResponse(RequestOptions reque
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2542,28 +2658,30 @@ public Response getUpdateComplianceWithResponse(RequestOptions reque private Mono> listGroupsSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listGroups(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext( + context -> service.listGroups(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * Gets a list of all device groups. The $default group will always be returned first. - * - *

Query Parameters - * + * Gets a list of all device groups. The $default group will always be returned + * first. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, + * deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -2576,8 +2694,9 @@ private Mono> listGroupsSinglePageAsync(RequestOptions
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2595,21 +2714,22 @@ public PagedFlux listGroupsAsync(RequestOptions requestOptions) { } /** - * Gets a list of all device groups. The $default group will always be returned first. - * - *

Query Parameters - * + * Gets a list of all device groups. The $default group will always be returned + * first. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, + * deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -2622,8 +2742,9 @@ public PagedFlux listGroupsAsync(RequestOptions requestOptions) {
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2634,28 +2755,30 @@ public PagedFlux listGroupsAsync(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listGroupsSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listGroupsSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res + = service.listGroupsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * Gets a list of all device groups. The $default group will always be returned first. - * - *

Query Parameters - * + * Gets a list of all device groups. The $default group will always be returned + * first. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, + * deviceCount, + * createdDate, subgroupsWithNewUpdatesAvailableCount, + * subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -2668,8 +2791,9 @@ private PagedResponse listGroupsSinglePage(RequestOptions requestOpt
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2688,10 +2812,10 @@ public PagedIterable listGroups(RequestOptions requestOptions) { /** * Gets the device group properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -2704,8 +2828,9 @@ public PagedIterable listGroups(RequestOptions requestOptions) {
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2717,16 +2842,17 @@ public PagedIterable listGroups(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getGroup(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getGroup(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, accept, requestOptions, context)); } /** * Gets the device group properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -2739,8 +2865,9 @@ public Mono> getGroupWithResponseAsync(String groupId, Requ
      *         String (Optional)
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2752,17 +2879,19 @@ public Mono> getGroupWithResponseAsync(String groupId, Requ @ServiceMethod(returns = ReturnType.SINGLE) public Response getGroupWithResponse(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getGroupSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getGroupSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, accept, requestOptions, Context.NONE); } /** - * Deletes a device group. This group is automatically created when a Device Update-enabled device is connected to - * the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned up but are - * retained for history purposes. Users can call this method to delete a group if they do not need to retain any of - * the history of the group and no longer need it. If a device is ever connected again for this group after the - * group was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device group. This group is automatically created when a Device + * Update-enabled device is connected to the hub and reports its properties. + * Groups, subgroups, and deployments are not automatically cleaned up but are + * retained for history purposes. Users can call this method to delete a group if + * they do not need to retain any of the history of the group and no longer need + * it. If a device is ever connected again for this group after the group was + * deleted it will be automatically re-created but there will be no history. + * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2773,19 +2902,20 @@ public Response getGroupWithResponse(String groupId, RequestOptions */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteGroup(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.deleteGroup(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, requestOptions, context)); } /** - * Deletes a device group. This group is automatically created when a Device Update-enabled device is connected to - * the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned up but are - * retained for history purposes. Users can call this method to delete a group if they do not need to retain any of - * the history of the group and no longer need it. If a device is ever connected again for this group after the - * group was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device group. This group is automatically created when a Device + * Update-enabled device is connected to the hub and reports its properties. + * Groups, subgroups, and deployments are not automatically cleaned up but are + * retained for history purposes. Users can call this method to delete a group if + * they do not need to retain any of the history of the group and no longer need + * it. If a device is ever connected again for this group after the group was + * deleted it will be automatically re-created but there will be no history. + * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2796,82 +2926,88 @@ public Mono> deleteGroupWithResponseAsync(String groupId, Request */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteGroupSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.deleteGroupSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, requestOptions, Context.NONE); } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link Response} on - * successful completion of {@link Mono}. + * @return 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 along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getUpdateComplianceForGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getUpdateComplianceForGroup(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getUpdateComplianceForGroup(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, requestOptions, + context)); } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link Response}. + * @return 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 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getUpdateComplianceForGroupWithResponse(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getUpdateComplianceForGroupSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getUpdateComplianceForGroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, requestOptions, + Context.NONE); } /** - * Get the best available updates for a device group and a count of how many devices need each update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -2886,35 +3022,37 @@ public Response getUpdateComplianceForGroupWithResponse(String group
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available updates for a device group and a count of how many devices need each update along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the best available updates for a device group and a count of how many + * devices need each update along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBestUpdatesForGroupSinglePageAsync(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listBestUpdatesForGroup(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext(context -> service.listBestUpdatesForGroup(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * Get the best available updates for a device group and a count of how many devices need each update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -2929,16 +3067,17 @@ private Mono> listBestUpdatesForGroupSinglePageAsync(S
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available updates for a device group and a count of how many devices need each update as - * paginated response with {@link PagedFlux}. + * @return the best available updates for a device group and a count of how many + * devices need each update as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listBestUpdatesForGroupAsync(String groupId, RequestOptions requestOptions) { @@ -2950,11 +3089,12 @@ public PagedFlux listBestUpdatesForGroupAsync(String groupId, Reques } /** - * Get the best available updates for a device group and a count of how many devices need each update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -2969,33 +3109,35 @@ public PagedFlux listBestUpdatesForGroupAsync(String groupId, Reques
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available updates for a device group and a count of how many devices need each update along with - * {@link PagedResponse}. + * @return the best available updates for a device group and a count of how many + * devices need each update along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listBestUpdatesForGroupSinglePage(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; - Response res - = service.listBestUpdatesForGroupSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res = service.listBestUpdatesForGroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, requestOptions, + Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * Get the best available updates for a device group and a count of how many devices need each update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -3010,16 +3152,17 @@ private PagedResponse listBestUpdatesForGroupSinglePage(String group
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available updates for a device group and a count of how many devices need each update as - * paginated response with {@link PagedIterable}. + * @return the best available updates for a device group and a count of how many + * devices need each update as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBestUpdatesForGroup(String groupId, RequestOptions requestOptions) { @@ -3032,20 +3175,18 @@ public PagedIterable listBestUpdatesForGroup(String groupId, Request /** * Gets a list of deployments for a device group. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3072,9 +3213,11 @@ public PagedIterable listBestUpdatesForGroup(String groupId, Request
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3082,36 +3225,34 @@ public PagedIterable listBestUpdatesForGroup(String groupId, Request * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of deployments for a device group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsForGroupSinglePageAsync(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listDeploymentsForGroup(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext(context -> service.listDeploymentsForGroup(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Gets a list of deployments for a device group. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3138,9 +3279,11 @@ private Mono> listDeploymentsForGroupSinglePageAsync(S
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3160,20 +3303,18 @@ public PagedFlux listDeploymentsForGroupAsync(String groupId, Reques /** * Gets a list of deployments for a device group. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3200,9 +3341,11 @@ public PagedFlux listDeploymentsForGroupAsync(String groupId, Reques
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3214,29 +3357,27 @@ public PagedFlux listDeploymentsForGroupAsync(String groupId, Reques @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDeploymentsForGroupSinglePage(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; - Response res - = service.listDeploymentsForGroupSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res = service.listDeploymentsForGroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, requestOptions, + Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Gets a list of deployments for a device group. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3263,9 +3404,11 @@ private PagedResponse listDeploymentsForGroupSinglePage(String group
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3285,10 +3428,10 @@ public PagedIterable listDeploymentsForGroup(String groupId, Request /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3315,9 +3458,11 @@ public PagedIterable listDeploymentsForGroup(String groupId, Request
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3331,17 +3476,17 @@ public PagedIterable listDeploymentsForGroup(String groupId, Request public Mono> getDeploymentWithResponseAsync(String groupId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDeployment(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getDeployment(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deploymentId, accept, requestOptions, context)); } /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3368,9 +3513,11 @@ public Mono> getDeploymentWithResponseAsync(String groupId,
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3384,16 +3531,16 @@ public Mono> getDeploymentWithResponseAsync(String groupId, public Response getDeploymentWithResponse(String groupId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDeploymentSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getDeploymentSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deploymentId, accept, requestOptions, Context.NONE); } /** * Creates or updates a deployment. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3420,12 +3567,15 @@ public Response getDeploymentWithResponse(String groupId, String dep
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3452,9 +3602,11 @@ public Response getDeploymentWithResponse(String groupId, String dep
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param deployment The deployment properties. @@ -3468,18 +3620,19 @@ public Response getDeploymentWithResponse(String groupId, String dep @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createOrUpdateDeploymentWithResponseAsync(String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createOrUpdateDeployment(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deploymentId, this.client.getServiceVersion().getVersion(), - deployment, accept, requestOptions, context)); + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deploymentId, + contentType, accept, deployment, requestOptions, context)); } /** * Creates or updates a deployment. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3506,12 +3659,15 @@ public Mono> createOrUpdateDeploymentWithResponseAsync(Stri
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -3522,92 +3678,54 @@ public Mono> createOrUpdateDeploymentWithResponseAsync(Stri
      *             version: String (Required)
      *         }
      *         description: String (Optional)
-     *         friendlyName: String (Optional)
-     *     }
-     *     groupId: String (Required)
-     *     deviceClassSubgroups (Optional): [
-     *         String (Optional)
-     *     ]
-     *     isCanceled: Boolean (Optional)
-     *     isRetried: Boolean (Optional)
-     *     rollbackPolicy (Optional): {
-     *         update (Required): (recursive schema, see update above)
-     *         failure (Required): {
-     *             devicesFailedPercentage: int (Required)
-     *             devicesFailedCount: int (Required)
-     *         }
-     *     }
-     *     isCloudInitiatedRollback: Boolean (Optional)
-     * }
-     * }
- * - * @param groupId Group identifier. - * @param deploymentId Deployment identifier. - * @param deployment The deployment properties. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return deployment metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateDeploymentWithResponse(String groupId, String deploymentId, - BinaryData deployment, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.createOrUpdateDeploymentSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deploymentId, this.client.getServiceVersion().getVersion(), deployment, accept, requestOptions, - Context.NONE); - } - - /** - * Deletes a deployment. - * - * @param groupId Group identifier. - * @param deploymentId Deployment identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeploymentWithResponseAsync(String groupId, String deploymentId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.deleteDeployment(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a deployment. - * + * friendlyName: String (Optional) + * } + * groupId: String (Required) + * deviceClassSubgroups (Optional): [ + * String (Optional) + * ] + * isCanceled: Boolean (Optional) + * isRetried: Boolean (Optional) + * rollbackPolicy (Optional): { + * update (Required): (recursive schema, see update above) + * failure (Required): { + * devicesFailedPercentage: int (Required) + * devicesFailedCount: int (Required) + * } + * } + * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) + * } + * } + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. + * @param deployment The deployment properties. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. + * @return deployment metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeploymentWithResponse(String groupId, String deploymentId, - RequestOptions requestOptions) { + public Response createOrUpdateDeploymentWithResponse(String groupId, String deploymentId, + BinaryData deployment, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.deleteDeploymentSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.createOrUpdateDeploymentSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deploymentId, + contentType, accept, deployment, requestOptions, Context.NONE); } /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled) (Required)
@@ -3640,8 +3758,9 @@ public Response deleteDeploymentWithResponse(String groupId, String deploy
      *         }
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3649,25 +3768,26 @@ public Response deleteDeploymentWithResponse(String groupId, String deploy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeploymentStatusWithResponseAsync(String groupId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getDeploymentStatus(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getDeploymentStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deploymentId, accept, + requestOptions, context)); } /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled) (Required)
@@ -3700,8 +3820,9 @@ public Mono> getDeploymentStatusWithResponseAsync(String gr
      *         }
      *     ]
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deploymentId Deployment identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3709,34 +3830,35 @@ public Mono> getDeploymentStatusWithResponseAsync(String gr * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeploymentStatusWithResponse(String groupId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDeploymentStatusSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getDeploymentStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deploymentId, accept, requestOptions, Context.NONE); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2')
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can + * filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2')
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -3744,8 +3866,9 @@ public Response getDeploymentStatusWithResponse(String groupId, Stri
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3753,7 +3876,7 @@ public Response getDeploymentStatusWithResponse(String groupId, Stri * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the device class subgroups for the group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceClassSubgroupsForGroupSinglePageAsync(String groupId, @@ -3761,29 +3884,30 @@ private Mono> listDeviceClassSubgroupsForGroupSinglePa final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeviceClassSubgroupsForGroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, this.client.getServiceVersion().getVersion(), accept, + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2')
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can + * filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2')
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -3791,8 +3915,9 @@ private Mono> listDeviceClassSubgroupsForGroupSinglePa
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3811,22 +3936,23 @@ public PagedFlux listDeviceClassSubgroupsForGroupAsync(String groupI } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2')
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can + * filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2')
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -3834,8 +3960,9 @@ public PagedFlux listDeviceClassSubgroupsForGroupAsync(String groupI
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3848,30 +3975,31 @@ public PagedFlux listDeviceClassSubgroupsForGroupAsync(String groupI private PagedResponse listDeviceClassSubgroupsForGroupSinglePage(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; - Response res - = service.listDeviceClassSubgroupsForGroupSync(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res = service.listDeviceClassSubgroupsForGroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, accept, requestOptions, + Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value. (i.e. filter=compatProperties/propertyName1 eq 'value1' and compatProperties/propertyName2 eq 'value2')
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can + * filter on compat + * properties by name and value. (i.e. filter=compatProperties/propertyName1 eq + * 'value1' and compatProperties/propertyName2 eq 'value2')
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -3879,8 +4007,9 @@ private PagedResponse listDeviceClassSubgroupsForGroupSinglePage(Str
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -3899,12 +4028,13 @@ public PagedIterable listDeviceClassSubgroupsForGroup(String groupId } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -3912,8 +4042,9 @@ public PagedIterable listDeviceClassSubgroupsForGroup(String groupId
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3927,18 +4058,19 @@ public PagedIterable listDeviceClassSubgroupsForGroup(String groupId public Mono> getDeviceClassSubgroupWithResponseAsync(String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getDeviceClassSubgroup(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getDeviceClassSubgroup(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, + requestOptions, context)); } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -3946,8 +4078,9 @@ public Mono> getDeviceClassSubgroupWithResponseAsync(String
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3961,17 +4094,21 @@ public Mono> getDeviceClassSubgroupWithResponseAsync(String public Response getDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDeviceClassSubgroupSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getDeviceClassSubgroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, + requestOptions, Context.NONE); } /** - * Deletes a device class subgroup. This subgroup is automatically created when a Device Update-enabled device is - * connected to the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned - * up but are retained for history purposes. Users can call this method to delete a subgroup if they do not need to - * retain any of the history of the subgroup and no longer need it. If a device is ever connected again for this - * subgroup after the subgroup was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device class subgroup. This subgroup is automatically created when a + * Device Update-enabled device is connected to the hub and reports its + * properties. Groups, subgroups, and deployments are not automatically cleaned up + * but are retained for history purposes. Users can call this method to delete a + * subgroup if they do not need to retain any of the history of the subgroup and + * no longer need it. If a device is ever connected again for this subgroup after + * the subgroup was deleted it will be automatically re-created but there will be + * no history. + * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -3984,19 +4121,21 @@ public Response getDeviceClassSubgroupWithResponse(String groupId, S @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteDeviceClassSubgroupWithResponseAsync(String groupId, String deviceClassId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.deleteDeviceClassSubgroup(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteDeviceClassSubgroup(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + requestOptions, context)); } /** - * Deletes a device class subgroup. This subgroup is automatically created when a Device Update-enabled device is - * connected to the hub and reports its properties. Groups, subgroups, and deployments are not automatically cleaned - * up but are retained for history purposes. Users can call this method to delete a subgroup if they do not need to - * retain any of the history of the subgroup and no longer need it. If a device is ever connected again for this - * subgroup after the subgroup was deleted it will be automatically re-created but there will be no history. - * + * Deletes a device class subgroup. This subgroup is automatically created when a + * Device Update-enabled device is connected to the hub and reports its + * properties. Groups, subgroups, and deployments are not automatically cleaned up + * but are retained for history purposes. Users can call this method to delete a + * subgroup if they do not need to retain any of the history of the subgroup and + * no longer need it. If a device is ever connected again for this subgroup after + * the subgroup was deleted it will be automatically re-created but there will be + * no history. + * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4009,26 +4148,28 @@ public Mono> deleteDeviceClassSubgroupWithResponseAsync(String gr @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteDeviceClassSubgroupSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.deleteDeviceClassSubgroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + requestOptions, Context.NONE); } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4036,34 +4177,36 @@ public Response deleteDeviceClassSubgroupWithResponse(String groupId, Stri * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link Response} - * on successful completion of {@link Mono}. + * @return 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 along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeviceClassSubgroupUpdateComplianceWithResponseAsync(String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.getDeviceClassSubgroupUpdateCompliance(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, this.client.getServiceVersion().getVersion(), accept, + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, requestOptions, context)); } /** - * 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. - * - *

Response Body Schema - * - *

{@code
+     * 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.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     totalDeviceCount: int (Required)
      *     onLatestUpdateDeviceCount: int (Required)
      *     newUpdatesAvailableDeviceCount: int (Required)
      *     updatesInProgressDeviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4071,25 +4214,26 @@ public Mono> getDeviceClassSubgroupUpdateComplianceWithResp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 along with {@link - * Response}. + * @return 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 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceClassSubgroupUpdateComplianceWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; return service.getDeviceClassSubgroupUpdateComplianceSync(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, this.client.getServiceVersion().getVersion(), accept, + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, requestOptions, Context.NONE); } /** - * Get the best available update for a device class subgroup and a count of how many devices need this update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available update for a device class subgroup and a count of how
+     * many devices need this update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -4104,8 +4248,9 @@ public Response getDeviceClassSubgroupUpdateComplianceWithResponse(S
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4113,24 +4258,25 @@ public Response getDeviceClassSubgroupUpdateComplianceWithResponse(S * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available update for a device class subgroup and a count of how many devices need this update - * along with {@link Response} on successful completion of {@link Mono}. + * @return the best available update for a device class subgroup and a count of how + * many devices need this update along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getBestUpdatesForDeviceClassSubgroupWithResponseAsync(String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.getBestUpdatesForDeviceClassSubgroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, this.client.getServiceVersion().getVersion(), accept, + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, requestOptions, context)); } /** - * Get the best available update for a device class subgroup and a count of how many devices need this update. - * - *

Response Body Schema - * - *

{@code
+     * Get the best available update for a device class subgroup and a count of how
+     * many devices need this update.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -4145,8 +4291,9 @@ public Mono> getBestUpdatesForDeviceClassSubgroupWithRespon
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4154,33 +4301,32 @@ public Mono> getBestUpdatesForDeviceClassSubgroupWithRespon * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the best available update for a device class subgroup and a count of how many devices need this update - * along with {@link Response}. + * @return the best available update for a device class subgroup and a count of how + * many devices need this update along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getBestUpdatesForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getBestUpdatesForDeviceClassSubgroupSync(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getBestUpdatesForDeviceClassSubgroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, + requestOptions, Context.NONE); } /** * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4207,9 +4353,11 @@ public Response getBestUpdatesForDeviceClassSubgroupWithResponse(Str
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4218,7 +4366,7 @@ public Response getBestUpdatesForDeviceClassSubgroupWithResponse(Str * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of deployments for a device class subgroup along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsForDeviceClassSubgroupSinglePageAsync(String groupId, @@ -4226,7 +4374,7 @@ private Mono> listDeploymentsForDeviceClassSubgroupSin final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeploymentsForDeviceClassSubgroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, this.client.getServiceVersion().getVersion(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); @@ -4234,20 +4382,18 @@ private Mono> listDeploymentsForDeviceClassSubgroupSin /** * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4274,9 +4420,11 @@ private Mono> listDeploymentsForDeviceClassSubgroupSin
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4299,20 +4447,18 @@ public PagedFlux listDeploymentsForDeviceClassSubgroupAsync(String g /** * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4339,9 +4485,11 @@ public PagedFlux listDeploymentsForDeviceClassSubgroupAsync(String g
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4356,7 +4504,7 @@ private PagedResponse listDeploymentsForDeviceClassSubgroupSinglePag String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; Response res = service.listDeploymentsForDeviceClassSubgroupSync(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, this.client.getServiceVersion().getVersion(), accept, + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); @@ -4364,20 +4512,18 @@ private PagedResponse listDeploymentsForDeviceClassSubgroupSinglePag /** * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start + * date.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4404,9 +4550,11 @@ private PagedResponse listDeploymentsForDeviceClassSubgroupSinglePag
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -4429,10 +4577,10 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup(String gr /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4459,9 +4607,11 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup(String gr
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4477,16 +4627,16 @@ public Mono> getDeploymentForDeviceClassSubgroupWithRespons String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.getDeploymentForDeviceClassSubgroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, accept, requestOptions, context)); } /** * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4513,9 +4663,11 @@ public Mono> getDeploymentForDeviceClassSubgroupWithRespons
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4530,61 +4682,17 @@ public Mono> getDeploymentForDeviceClassSubgroupWithRespons public Response getDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getDeploymentForDeviceClassSubgroupSync(this.client.getEndpoint(), this.client.getInstanceId(), - groupId, deviceClassId, deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, - Context.NONE); - } - - /** - * Deletes a device class subgroup deployment. - * - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeploymentForDeviceClassSubgroupWithResponseAsync(String groupId, - String deviceClassId, String deploymentId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteDeploymentForDeviceClassSubgroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes a device class subgroup deployment. - * - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - String deploymentId, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteDeploymentForDeviceClassSubgroupSync(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getDeploymentForDeviceClassSubgroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, accept, requestOptions, Context.NONE); } /** * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4611,9 +4719,11 @@ public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4628,17 +4738,17 @@ public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String public Mono> stopDeploymentWithResponseAsync(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.stopDeployment(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.stopDeployment(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deviceClassId, deploymentId, accept, requestOptions, context)); } /** * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4665,9 +4775,11 @@ public Mono> stopDeploymentWithResponseAsync(String groupId
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4682,17 +4794,16 @@ public Mono> stopDeploymentWithResponseAsync(String groupId public Response stopDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.stopDeploymentSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deviceClassId, deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, - Context.NONE); + return service.stopDeploymentSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deviceClassId, deploymentId, accept, requestOptions, Context.NONE); } /** * Retries a deployment with failed devices. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4719,9 +4830,11 @@ public Response stopDeploymentWithResponse(String groupId, String de
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4736,17 +4849,17 @@ public Response stopDeploymentWithResponse(String groupId, String de public Mono> retryDeploymentWithResponseAsync(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.retryDeployment(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.retryDeployment(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deviceClassId, deploymentId, accept, requestOptions, context)); } /** * Retries a deployment with failed devices. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -4773,9 +4886,11 @@ public Mono> retryDeploymentWithResponseAsync(String groupI
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
+     * }
      * }
-     * }
- * + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4790,18 +4905,17 @@ public Mono> retryDeploymentWithResponseAsync(String groupI public Response retryDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.retryDeploymentSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deviceClassId, deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, - Context.NONE); + return service.retryDeploymentSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deviceClassId, deploymentId, accept, requestOptions, Context.NONE); } /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -4827,8 +4941,9 @@ public Response retryDeploymentWithResponse(String groupId, String d
      *     devicesCompletedSucceededCount: Integer (Optional)
      *     devicesCanceledCount: Integer (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4837,25 +4952,26 @@ public Response retryDeploymentWithResponse(String groupId, String d * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeviceClassSubgroupDeploymentStatusWithResponseAsync(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.getDeviceClassSubgroupDeploymentStatus(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, accept, requestOptions, context)); } /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. - * - *

Response Body Schema - * - *

{@code
+     * Gets the status of a deployment including a breakdown of how many devices in
+     * the deployment are in progress, completed, or failed.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -4881,8 +4997,9 @@ public Mono> getDeviceClassSubgroupDeploymentStatusWithResp
      *     devicesCompletedSucceededCount: Integer (Optional)
      *     devicesCanceledCount: Integer (Optional)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4891,34 +5008,34 @@ public Mono> getDeviceClassSubgroupDeploymentStatusWithResp * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed along with {@link Response}. + * @return the status of a deployment including a breakdown of how many devices in + * the deployment are in progress, completed, or failed along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceClassSubgroupDeploymentStatusWithResponse(String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return service.getDeviceClassSubgroupDeploymentStatusSync(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, accept, requestOptions, Context.NONE); } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. - * - *

Query Parameters - * + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can + * filter on + * deviceId and moduleId and/or deviceState.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -4926,8 +5043,9 @@ public Response getDeviceClassSubgroupDeploymentStatusWithResponse(S
      *     movedOnToNewDeployment: boolean (Required)
      *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -4937,7 +5055,7 @@ public Response getDeviceClassSubgroupDeploymentStatusWithResponse(S * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of devices in a deployment along with their state along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceStatesForDeviceClassSubgroupDeploymentSinglePageAsync( @@ -4945,28 +5063,28 @@ private Mono> listDeviceStatesForDeviceClassSubgroupDe final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeviceStatesForDeviceClassSubgroupDeployment(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. - * - *

Query Parameters - * + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can + * filter on + * deviceId and moduleId and/or deviceState.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -4974,8 +5092,9 @@ private Mono> listDeviceStatesForDeviceClassSubgroupDe
      *     movedOnToNewDeployment: boolean (Required)
      *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -5000,21 +5119,21 @@ public PagedFlux listDeviceStatesForDeviceClassSubgroupDeploymentAsy } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. - * - *

Query Parameters - * + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can + * filter on + * deviceId and moduleId and/or deviceState.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -5022,8 +5141,9 @@ public PagedFlux listDeviceStatesForDeviceClassSubgroupDeploymentAsy
      *     movedOnToNewDeployment: boolean (Required)
      *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -5039,28 +5159,28 @@ private PagedResponse listDeviceStatesForDeviceClassSubgroupDeployme String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; Response res = service.listDeviceStatesForDeviceClassSubgroupDeploymentSync( - this.client.getEndpoint(), this.client.getInstanceId(), groupId, deviceClassId, deploymentId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), + groupId, deviceClassId, deploymentId, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. - * - *

Query Parameters - * + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can + * filter on + * deviceId and moduleId and/or deviceState.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -5068,8 +5188,9 @@ private PagedResponse listDeviceStatesForDeviceClassSubgroupDeployme
      *     movedOnToNewDeployment: boolean (Required)
      *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
-     * }
- * + * } + *
+ * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -5078,8 +5199,8 @@ private PagedResponse listDeviceStatesForDeviceClassSubgroupDeployme * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of devices in a deployment along with their state as paginated response with {@link - * PagedIterable}. + * @return a list of devices in a deployment along with their state as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, @@ -5096,20 +5217,19 @@ public PagedIterable listDeviceStatesForDeviceClassSubgroupDeploymen /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -5133,8 +5253,9 @@ public PagedIterable listDeviceStatesForDeviceClassSubgroupDeploymen
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -5147,27 +5268,26 @@ public PagedIterable listDeviceStatesForDeviceClassSubgroupDeploymen public Mono> getOperationStatusWithResponseAsync(String operationId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getOperationStatus(this.client.getEndpoint(), this.client.getInstanceId(), - operationId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getOperationStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), operationId, accept, + requestOptions, context)); } /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -5191,8 +5311,9 @@ public Mono> getOperationStatusWithResponseAsync(String ope
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -5204,27 +5325,30 @@ public Mono> getOperationStatusWithResponseAsync(String ope @ServiceMethod(returns = ReturnType.SINGLE) public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getInstanceId(), operationId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), operationId, accept, requestOptions, Context.NONE); } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. - * - *

Query Parameters - * + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -5248,44 +5372,46 @@ public Response getOperationStatusWithResponse(String operationId, R
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all device import operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationStatusesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listOperationStatuses(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + return FluxUtil.withContext(context -> service.listOperationStatuses(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. - * - *

Query Parameters - * + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -5309,8 +5435,9 @@ private Mono> listOperationStatusesSinglePageAsync(Req
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5328,22 +5455,25 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. - * - *

Query Parameters - * + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -5367,8 +5497,9 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5380,29 +5511,32 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp private PagedResponse listOperationStatusesSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listOperationStatusesSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + = service.listOperationStatusesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. - * - *

Query Parameters - * + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -5426,8 +5560,9 @@ private PagedResponse listOperationStatusesSinglePage(RequestOptions
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5446,10 +5581,10 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt /** * Start the device diagnostics log collection on specified devices. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5463,11 +5598,13 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5481,8 +5618,9 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param logCollection The log collection properties. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -5495,18 +5633,19 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Mono> startLogCollectionWithResponseAsync(String logCollectionId, BinaryData logCollection, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.startLogCollection(this.client.getEndpoint(), - this.client.getInstanceId(), logCollectionId, this.client.getServiceVersion().getVersion(), logCollection, - accept, requestOptions, context)); + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), logCollectionId, contentType, + accept, logCollection, requestOptions, context)); } /** * Start the device diagnostics log collection on specified devices. - * - *

Request Body Schema - * - *

{@code
+     * 

Request Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5520,11 +5659,13 @@ public Mono> startLogCollectionWithResponseAsync(String log
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5538,8 +5679,9 @@ public Mono> startLogCollectionWithResponseAsync(String log
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param logCollection The log collection properties. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -5552,17 +5694,19 @@ public Mono> startLogCollectionWithResponseAsync(String log @ServiceMethod(returns = ReturnType.SINGLE) public Response startLogCollectionWithResponse(String logCollectionId, BinaryData logCollection, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.startLogCollectionSync(this.client.getEndpoint(), this.client.getInstanceId(), logCollectionId, - this.client.getServiceVersion().getVersion(), logCollection, accept, requestOptions, Context.NONE); + return service.startLogCollectionSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), logCollectionId, contentType, accept, logCollection, requestOptions, + Context.NONE); } /** * Get the device diagnostics log collection. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5576,32 +5720,33 @@ public Response startLogCollectionWithResponse(String logCollectionI
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the device diagnostics log collection along with {@link Response} on successful completion of {@link - * Mono}. + * @return the device diagnostics log collection along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getLogCollectionWithResponseAsync(String logCollectionId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getLogCollection(this.client.getEndpoint(), this.client.getInstanceId(), - logCollectionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getLogCollection(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), logCollectionId, accept, requestOptions, context)); } /** * Get the device diagnostics log collection. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5615,8 +5760,9 @@ public Mono> getLogCollectionWithResponseAsync(String logCo
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -5628,16 +5774,16 @@ public Mono> getLogCollectionWithResponseAsync(String logCo @ServiceMethod(returns = ReturnType.SINGLE) public Response getLogCollectionWithResponse(String logCollectionId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getLogCollectionSync(this.client.getEndpoint(), this.client.getInstanceId(), logCollectionId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getLogCollectionSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), logCollectionId, accept, requestOptions, Context.NONE); } /** * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5651,32 +5797,32 @@ public Response getLogCollectionWithResponse(String logCollectionId,
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return all device diagnostics log collections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listLogCollectionsSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listLogCollections(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + return FluxUtil.withContext(context -> service.listLogCollections(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5690,8 +5836,9 @@ private Mono> listLogCollectionsSinglePageAsync(Reques
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5710,10 +5857,10 @@ public PagedFlux listLogCollectionsAsync(RequestOptions requestOptio /** * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5727,8 +5874,9 @@ public PagedFlux listLogCollectionsAsync(RequestOptions requestOptio
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5740,18 +5888,18 @@ public PagedFlux listLogCollectionsAsync(RequestOptions requestOptio private PagedResponse listLogCollectionsSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listLogCollectionsSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + = service.listLogCollectionsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -5765,8 +5913,9 @@ private PagedResponse listLogCollectionsSinglePage(RequestOptions re
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5785,10 +5934,10 @@ public PagedIterable listLogCollections(RequestOptions requestOption /** * Get log collection with detailed status. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     createdDateTime: String (Optional)
@@ -5806,8 +5955,9 @@ public PagedIterable listLogCollections(RequestOptions requestOption
      *     ]
      *     description: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -5820,17 +5970,17 @@ public PagedIterable listLogCollections(RequestOptions requestOption public Mono> getLogCollectionDetailedStatusWithResponseAsync(String logCollectionId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.getLogCollectionDetailedStatus(this.client.getEndpoint(), this.client.getInstanceId(), - logCollectionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getLogCollectionDetailedStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), logCollectionId, accept, + requestOptions, context)); } /** * Get log collection with detailed status. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     createdDateTime: String (Optional)
@@ -5848,8 +5998,9 @@ public Mono> getLogCollectionDetailedStatusWithResponseAsyn
      *     ]
      *     description: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param logCollectionId Log collection identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -5862,16 +6013,17 @@ public Mono> getLogCollectionDetailedStatusWithResponseAsyn public Response getLogCollectionDetailedStatusWithResponse(String logCollectionId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getLogCollectionDetailedStatusSync(this.client.getEndpoint(), this.client.getInstanceId(), - logCollectionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getLogCollectionDetailedStatusSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), logCollectionId, accept, + requestOptions, Context.NONE); } /** * Get list of device health. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -5884,10 +6036,11 @@ public Response getLogCollectionDetailedStatusWithResponse(String lo
      *         }
      *     ]
      * }
-     * }
- * - * @param filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * } + *
+ * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5900,18 +6053,19 @@ private Mono> listHealthOfDevicesSinglePageAsync(Strin RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listHealthOfDevices(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), filter, accept, requestOptions, context)) + .withContext(context -> service.listHealthOfDevices(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), filter, accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get list of device health. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -5924,10 +6078,11 @@ private Mono> listHealthOfDevicesSinglePageAsync(Strin
      *         }
      *     ]
      * }
-     * }
- * - * @param filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * } + *
+ * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5946,10 +6101,10 @@ public PagedFlux listHealthOfDevicesAsync(String filter, RequestOpti /** * Get list of device health. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -5962,10 +6117,11 @@ public PagedFlux listHealthOfDevicesAsync(String filter, RequestOpti
      *         }
      *     ]
      * }
-     * }
- * - * @param filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * } + *
+ * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -5977,18 +6133,18 @@ public PagedFlux listHealthOfDevicesAsync(String filter, RequestOpti private PagedResponse listHealthOfDevicesSinglePage(String filter, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listHealthOfDevicesSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), filter, accept, requestOptions, Context.NONE); + = service.listHealthOfDevicesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), filter, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get list of device health. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -6001,10 +6157,11 @@ private PagedResponse listHealthOfDevicesSinglePage(String filter, R
      *         }
      *     ]
      * }
-     * }
- * - * @param filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * } + *
+ * + * @param filter Restricts the set of devices for which device health is returned. You can + * filter on status, device id and module id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -6021,12 +6178,93 @@ public PagedIterable listHealthOfDevices(String filter, RequestOptio nextLink -> listHealthOfDevicesNextSinglePage(nextLink, requestOptionsForNextPage)); } + /** + * Deletes a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeploymentWithResponseAsync(String groupId, String deploymentId, + RequestOptions requestOptions) { + return FluxUtil.withContext( + context -> service.deleteDeployment(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deploymentId, requestOptions, context)); + } + + /** + * Deletes a deployment. + * + * @param groupId Group identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeploymentWithResponse(String groupId, String deploymentId, + RequestOptions requestOptions) { + return service.deleteDeploymentSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), groupId, deploymentId, requestOptions, Context.NONE); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeploymentForDeviceClassSubgroupWithResponseAsync(String groupId, + String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.deleteDeploymentForDeviceClassSubgroup(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, requestOptions, context)); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identifier. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, + String deploymentId, RequestOptions requestOptions) { + return service.deleteDeploymentForDeviceClassSubgroupSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, requestOptions, Context.NONE); + } + /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -6049,16 +6287,19 @@ public PagedIterable listHealthOfDevices(String filter, RequestOptio
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of device classes along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return 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 along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceClassesNextSinglePageAsync(String nextLink, @@ -6073,10 +6314,10 @@ private Mono> listDeviceClassesNextSinglePageAsync(Str /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     friendlyName: String (Optional)
@@ -6099,16 +6340,19 @@ private Mono> listDeviceClassesNextSinglePageAsync(Str
      *         friendlyName: String (Optional)
      *     }
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of device classes along with {@link PagedResponse}. + * @return 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 along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDeviceClassesNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -6121,10 +6365,10 @@ private PagedResponse listDeviceClassesNextSinglePage(String nextLin /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -6134,16 +6378,17 @@ private PagedResponse listDeviceClassesNextSinglePage(String nextLin
      *     description: String (Optional)
      *     friendlyName: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return list of update information along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of installable updates for a device class along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listInstallableUpdatesForDeviceClassNextSinglePageAsync(String nextLink, @@ -6158,10 +6403,10 @@ private Mono> listInstallableUpdatesForDeviceClassNext /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -6171,16 +6416,16 @@ private Mono> listInstallableUpdatesForDeviceClassNext
      *     description: String (Optional)
      *     friendlyName: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return list of update information along with {@link PagedResponse}. + * @return a list of installable updates for a device class along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listInstallableUpdatesForDeviceClassNextSinglePage(String nextLink, @@ -6194,10 +6439,10 @@ private PagedResponse listInstallableUpdatesForDeviceClassNextSingle /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -6231,16 +6476,17 @@ private PagedResponse listInstallableUpdatesForDeviceClassNextSingle
      *         ]
      *     }
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of devices along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of devices connected to Device Update for IoT Hub along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDevicesNextSinglePageAsync(String nextLink, @@ -6254,10 +6500,10 @@ private Mono> listDevicesNextSinglePageAsync(String ne /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -6291,16 +6537,16 @@ private Mono> listDevicesNextSinglePageAsync(String ne
      *         ]
      *     }
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of devices along with {@link PagedResponse}. + * @return a list of devices connected to Device Update for IoT Hub along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDevicesNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -6313,10 +6559,10 @@ private PagedResponse listDevicesNextSinglePage(String nextLink, Req /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -6329,16 +6575,16 @@ private PagedResponse listDevicesNextSinglePage(String nextLink, Req
      *         String (Optional)
      *     ]
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of groups along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of all device groups along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listGroupsNextSinglePageAsync(String nextLink, @@ -6353,10 +6599,10 @@ private Mono> listGroupsNextSinglePageAsync(String nex /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
@@ -6369,16 +6615,16 @@ private Mono> listGroupsNextSinglePageAsync(String nex
      *         String (Optional)
      *     ]
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of groups along with {@link PagedResponse}. + * @return a list of all device groups along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listGroupsNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -6391,10 +6637,10 @@ private PagedResponse listGroupsNextSinglePage(String nextLink, Requ /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -6409,17 +6655,17 @@ private PagedResponse listGroupsNextSinglePage(String nextLink, Requ
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of updatable devices for a device class subgroup along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the best available updates for a device group and a count of how many + * devices need each update along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBestUpdatesForGroupNextSinglePageAsync(String nextLink, @@ -6434,10 +6680,10 @@ private Mono> listBestUpdatesForGroupNextSinglePageAsy /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     groupId: String (Required)
      *     deviceClassId: String (Required)
@@ -6452,16 +6698,17 @@ private Mono> listBestUpdatesForGroupNextSinglePageAsy
      *     }
      *     deviceCount: int (Required)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of updatable devices for a device class subgroup along with {@link PagedResponse}. + * @return the best available updates for a device group and a count of how many + * devices need each update along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listBestUpdatesForGroupNextSinglePage(String nextLink, @@ -6475,10 +6722,10 @@ private PagedResponse listBestUpdatesForGroupNextSinglePage(String n /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -6505,17 +6752,19 @@ private PagedResponse listBestUpdatesForGroupNextSinglePage(String n
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of deployments for a device group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsForGroupNextSinglePageAsync(String nextLink, @@ -6530,10 +6779,10 @@ private Mono> listDeploymentsForGroupNextSinglePageAsy /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -6560,17 +6809,18 @@ private Mono> listDeploymentsForGroupNextSinglePageAsy
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployments along with {@link PagedResponse}. + * @return a list of deployments for a device group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDeploymentsForGroupNextSinglePage(String nextLink, @@ -6584,10 +6834,10 @@ private PagedResponse listDeploymentsForGroupNextSinglePage(String n /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -6595,17 +6845,17 @@ private PagedResponse listDeploymentsForGroupNextSinglePage(String n
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of device class subgroups within a group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the device class subgroups for the group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceClassSubgroupsForGroupNextSinglePageAsync(String nextLink, @@ -6620,10 +6870,10 @@ private Mono> listDeviceClassSubgroupsForGroupNextSing /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceClassId: String (Required)
      *     groupId: String (Required)
@@ -6631,16 +6881,16 @@ private Mono> listDeviceClassSubgroupsForGroupNextSing
      *     deviceCount: Integer (Optional)
      *     deploymentId: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of device class subgroups within a group along with {@link PagedResponse}. + * @return the device class subgroups for the group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDeviceClassSubgroupsForGroupNextSinglePage(String nextLink, @@ -6654,10 +6904,10 @@ private PagedResponse listDeviceClassSubgroupsForGroupNextSinglePage /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -6684,17 +6934,19 @@ private PagedResponse listDeviceClassSubgroupsForGroupNextSinglePage
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of deployments for a device class subgroup along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsForDeviceClassSubgroupNextSinglePageAsync(String nextLink, @@ -6709,10 +6961,10 @@ private Mono> listDeploymentsForDeviceClassSubgroupNex /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -6739,17 +6991,18 @@ private Mono> listDeploymentsForDeviceClassSubgroupNex
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployments along with {@link PagedResponse}. + * @return a list of deployments for a device class subgroup along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDeploymentsForDeviceClassSubgroupNextSinglePage(String nextLink, @@ -6763,10 +7016,10 @@ private PagedResponse listDeploymentsForDeviceClassSubgroupNextSingl /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -6774,17 +7027,17 @@ private PagedResponse listDeploymentsForDeviceClassSubgroupNextSingl
      *     movedOnToNewDeployment: boolean (Required)
      *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployment device states along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return a list of devices in a deployment along with their state along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePageAsync( @@ -6799,10 +7052,10 @@ private Mono> listDeviceStatesForDeviceClassSubgroupDe /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -6810,16 +7063,16 @@ private Mono> listDeviceStatesForDeviceClassSubgroupDe
      *     movedOnToNewDeployment: boolean (Required)
      *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployment device states along with {@link PagedResponse}. + * @return a list of devices in a deployment along with their state along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePage(String nextLink, @@ -6833,10 +7086,10 @@ private PagedResponse listDeviceStatesForDeviceClassSubgroupDeployme /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -6860,17 +7113,17 @@ private PagedResponse listDeviceStatesForDeviceClassSubgroupDeployme
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of device operations with server paging support along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of all device import operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationStatusesNextSinglePageAsync(String nextLink, @@ -6885,10 +7138,10 @@ private Mono> listOperationStatusesNextSinglePageAsync /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -6912,16 +7165,16 @@ private Mono> listOperationStatusesNextSinglePageAsync
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of device operations with server paging support along with {@link PagedResponse}. + * @return a list of all device import operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listOperationStatusesNextSinglePage(String nextLink, @@ -6935,10 +7188,10 @@ private PagedResponse listOperationStatusesNextSinglePage(String nex /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -6952,17 +7205,17 @@ private PagedResponse listOperationStatusesNextSinglePage(String nex
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of log collections with server paging support along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all device diagnostics log collections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listLogCollectionsNextSinglePageAsync(String nextLink, @@ -6977,10 +7230,10 @@ private Mono> listLogCollectionsNextSinglePageAsync(St /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Optional)
      *     deviceList (Required): [
@@ -6994,16 +7247,16 @@ private Mono> listLogCollectionsNextSinglePageAsync(St
      *     lastActionDateTime: String (Optional)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of log collections with server paging support along with {@link PagedResponse}. + * @return all device diagnostics log collections along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listLogCollectionsNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -7016,10 +7269,10 @@ private PagedResponse listLogCollectionsNextSinglePage(String nextLi /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -7032,17 +7285,16 @@ private PagedResponse listLogCollectionsNextSinglePage(String nextLi
      *         }
      *     ]
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return array of Device Health, with server paging support along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return list of device health along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listHealthOfDevicesNextSinglePageAsync(String nextLink, @@ -7057,10 +7309,10 @@ private Mono> listHealthOfDevicesNextSinglePageAsync(S /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deviceId: String (Required)
      *     moduleId: String (Optional)
@@ -7073,16 +7325,16 @@ private Mono> listHealthOfDevicesNextSinglePageAsync(S
      *         }
      *     ]
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return array of Device Health, with server paging support along with {@link PagedResponse}. + * @return list of device health along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listHealthOfDevicesNextSinglePage(String nextLink, diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java index 076945cfa44d..2260325fef4c 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java @@ -1,98 +1,113 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.implementation; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.iot.deviceupdate.DeviceUpdateServiceVersion; -/** Initializes a new instance of the DeviceUpdateClient type. */ +/** + * Initializes a new instance of the DeviceUpdateClient type. + */ public final class DeviceUpdateClientImpl { - /** The Device Update for IoT Hub account endpoint (hostname only, no protocol). */ + /** + * The Device Update for IoT Hub account endpoint (hostname only, no protocol). + */ private final String endpoint; /** * Gets The Device Update for IoT Hub account endpoint (hostname only, no protocol). - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** The Device Update for IoT Hub account instance identifier. */ + /** + * The Device Update for IoT Hub account instance identifier. + */ private final String instanceId; /** * Gets The Device Update for IoT Hub account instance identifier. - * + * * @return the instanceId value. */ public String getInstanceId() { return this.instanceId; } - /** Service version. */ + /** + * Service version. + */ private final DeviceUpdateServiceVersion serviceVersion; /** * Gets Service version. - * + * * @return the serviceVersion value. */ public DeviceUpdateServiceVersion getServiceVersion() { return this.serviceVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The DeviceUpdatesImpl object to access its operations. */ + /** + * The DeviceUpdatesImpl object to access its operations. + */ private final DeviceUpdatesImpl deviceUpdates; /** * Gets the DeviceUpdatesImpl object to access its operations. - * + * * @return the DeviceUpdatesImpl object. */ public DeviceUpdatesImpl getDeviceUpdates() { return this.deviceUpdates; } - /** The DeviceManagementsImpl object to access its operations. */ + /** + * The DeviceManagementsImpl object to access its operations. + */ private final DeviceManagementsImpl deviceManagements; /** * Gets the DeviceManagementsImpl object to access its operations. - * + * * @return the DeviceManagementsImpl object. */ public DeviceManagementsImpl getDeviceManagements() { @@ -101,19 +116,19 @@ public DeviceManagementsImpl getDeviceManagements() { /** * Initializes an instance of DeviceUpdateClient client. - * + * * @param endpoint The Device Update for IoT Hub account endpoint (hostname only, no protocol). * @param instanceId The Device Update for IoT Hub account instance identifier. * @param serviceVersion Service version. */ public DeviceUpdateClientImpl(String endpoint, String instanceId, DeviceUpdateServiceVersion serviceVersion) { - this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()).build(), + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), JacksonAdapter.createDefaultSerializerAdapter(), endpoint, instanceId, serviceVersion); } /** * Initializes an instance of DeviceUpdateClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The Device Update for IoT Hub account endpoint (hostname only, no protocol). * @param instanceId The Device Update for IoT Hub account instance identifier. @@ -126,7 +141,7 @@ public DeviceUpdateClientImpl(HttpPipeline httpPipeline, String endpoint, String /** * Initializes an instance of DeviceUpdateClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The Device Update for IoT Hub account endpoint (hostname only, no protocol). diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java index 204b3f4c3e71..2de9a72ca62b 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.implementation; @@ -32,28 +32,37 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.PollingStrategyOptions; import com.azure.core.util.polling.SyncDefaultPollingStrategy; import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.TypeReference; +import com.azure.iot.deviceupdate.DeviceUpdateServiceVersion; +import com.azure.iot.deviceupdate.models.UpdateOperation; import java.time.Duration; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DeviceUpdates. */ +/** + * An instance of this class provides access to all the operations defined in DeviceUpdates. + */ public final class DeviceUpdatesImpl { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DeviceUpdatesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final DeviceUpdateClientImpl client; /** * Initializes an instance of DeviceUpdatesImpl. - * + * * @param client the instance of the service client containing this operation class. */ DeviceUpdatesImpl(DeviceUpdateClientImpl client) { @@ -62,12 +71,21 @@ public final class DeviceUpdatesImpl { this.client = client; } + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public DeviceUpdateServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + /** * The interface defining all the services for DeviceUpdateClientDeviceUpdates to be used by the proxy service to * perform REST calls. */ @Host("https://{endpoint}") - @ServiceInterface(name = "DeviceUpdateClientDe") + @ServiceInterface(name = "DeviceUpdateClientDeviceUpdates") public interface DeviceUpdatesService { @Get("/deviceUpdate/{instanceId}/updates") @ExpectedResponses({ 200 }) @@ -76,9 +94,8 @@ public interface DeviceUpdatesService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listUpdates(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates") @ExpectedResponses({ 200 }) @@ -87,9 +104,8 @@ Mono> listUpdates(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listUpdatesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/updates:import") @ExpectedResponses({ 200, 202 }) @@ -98,9 +114,9 @@ Response listUpdatesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> importUpdate(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData updateToImport, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateToImport, RequestOptions requestOptions, Context context); @Post("/deviceUpdate/{instanceId}/updates:import") @ExpectedResponses({ 200, 202 }) @@ -109,9 +125,9 @@ Mono> importUpdate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response importUpdateSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") BinaryData updateToImport, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateToImport, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") @ExpectedResponses({ 200 }) @@ -120,10 +136,10 @@ Response importUpdateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getUpdate(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") @ExpectedResponses({ 200 }) @@ -132,10 +148,10 @@ Mono> getUpdate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getUpdateSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Delete("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") @ExpectedResponses({ 202 }) @@ -144,10 +160,9 @@ Response getUpdateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteUpdate(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, RequestOptions requestOptions, Context context); @Delete("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") @ExpectedResponses({ 202 }) @@ -156,10 +171,9 @@ Mono> deleteUpdate(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteUpdateSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/providers") @ExpectedResponses({ 200 }) @@ -168,9 +182,8 @@ Response deleteUpdateSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listProviders(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/providers") @ExpectedResponses({ 200 }) @@ -179,9 +192,8 @@ Mono> listProviders(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listProvidersSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names") @ExpectedResponses({ 200 }) @@ -190,9 +202,9 @@ Response listProvidersSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNames(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names") @ExpectedResponses({ 200 }) @@ -201,9 +213,9 @@ Mono> listNames(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listNamesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions") @ExpectedResponses({ 200 }) @@ -212,8 +224,8 @@ Response listNamesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listVersions(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions") @@ -223,8 +235,8 @@ Mono> listVersions(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listVersionsSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @QueryParam("api-version") String apiVersion, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files") @@ -234,10 +246,10 @@ Response listVersionsSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listFiles(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files") @ExpectedResponses({ 200 }) @@ -246,10 +258,10 @@ Mono> listFiles(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listFilesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}") @ExpectedResponses({ 200 }) @@ -258,10 +270,10 @@ Response listFilesSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getFile(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, @PathParam("fileId") String fileId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, @PathParam("fileId") String fileId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}") @ExpectedResponses({ 200 }) @@ -270,10 +282,10 @@ Mono> getFile(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getFileSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("provider") String provider, - @PathParam("name") String name, @PathParam("version") String version, @PathParam("fileId") String fileId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("provider") String provider, @PathParam("name") String name, + @PathParam("version") String version, @PathParam("fileId") String fileId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/operations") @ExpectedResponses({ 200 }) @@ -282,9 +294,8 @@ Response getFileSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listOperationStatuses(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/operations") @ExpectedResponses({ 200 }) @@ -293,9 +304,8 @@ Mono> listOperationStatuses(@HostParam("endpoint") String e @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listOperationStatusesSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/operations/{operationId}") @ExpectedResponses({ 200 }) @@ -304,9 +314,9 @@ Response listOperationStatusesSync(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getOperationStatus(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/updates/operations/{operationId}") @ExpectedResponses({ 200 }) @@ -315,9 +325,9 @@ Mono> getOperationStatus(@HostParam("endpoint") String endp @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getOperationStatusSync(@HostParam("endpoint") String endpoint, - @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -442,21 +452,19 @@ Response listOperationStatusesNextSync( /** * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search + * expression.
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -470,16 +478,20 @@ Response listOperationStatusesNextSync(
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -496,43 +508,43 @@ Response listOperationStatusesNextSync(
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all updates that have been imported to Device Update for IoT Hub along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of all updates that have been imported to Device Update for IoT Hub along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listUpdatesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUpdates(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext( + context -> service.listUpdates(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search + * expression.
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -546,16 +558,20 @@ private Mono> listUpdatesSinglePageAsync(RequestOption
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -572,15 +588,16 @@ private Mono> listUpdatesSinglePageAsync(RequestOption
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listUpdatesAsync(RequestOptions requestOptions) { @@ -593,21 +610,19 @@ public PagedFlux listUpdatesAsync(RequestOptions requestOptions) { /** * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search + * expression.
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -621,16 +636,20 @@ public PagedFlux listUpdatesAsync(RequestOptions requestOptions) {
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -647,42 +666,42 @@ public PagedFlux listUpdatesAsync(RequestOptions requestOptions) {
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all updates that have been imported to Device Update for IoT Hub along with {@link - * PagedResponse}. + * @return a list of all updates that have been imported to Device Update for IoT Hub along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listUpdatesSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listUpdatesSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res + = service.listUpdatesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search + * expression.
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -696,16 +715,20 @@ private PagedResponse listUpdatesSinglePage(RequestOptions requestOp
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -722,15 +745,16 @@ private PagedResponse listUpdatesSinglePage(RequestOptions requestOp
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listUpdates(RequestOptions requestOptions) { @@ -742,12 +766,12 @@ public PagedIterable listUpdates(RequestOptions requestOptions) { } /** - * Import new update version. This is a long-running-operation; use Operation-Location response header value to - * check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import new update version. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * [
      *      (Required){
      *         importManifest (Required): {
@@ -766,11 +790,13 @@ public PagedIterable listUpdates(RequestOptions requestOptions) {
      *         ]
      *     }
      * ]
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -784,16 +810,20 @@ public PagedIterable listUpdates(RequestOptions requestOptions) {
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -810,10 +840,12 @@ public PagedIterable listUpdates(RequestOptions requestOptions) {
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param updateToImport The update to be imported (see schema - * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for details). + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -824,19 +856,20 @@ public PagedIterable listUpdates(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> importUpdateWithResponseAsync(BinaryData updateToImport, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.importUpdate(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), updateToImport, accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.importUpdate(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), contentType, accept, updateToImport, requestOptions, context)); } /** - * Import new update version. This is a long-running-operation; use Operation-Location response header value to - * check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import new update version. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * [
      *      (Required){
      *         importManifest (Required): {
@@ -855,11 +888,13 @@ private Mono> importUpdateWithResponseAsync(BinaryData upda
      *         ]
      *     }
      * ]
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -873,16 +908,20 @@ private Mono> importUpdateWithResponseAsync(BinaryData upda
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -899,10 +938,12 @@ private Mono> importUpdateWithResponseAsync(BinaryData upda
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param updateToImport The update to be imported (see schema - * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for details). + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -912,18 +953,19 @@ private Mono> importUpdateWithResponseAsync(BinaryData upda */ @ServiceMethod(returns = ReturnType.SINGLE) private Response importUpdateWithResponse(BinaryData updateToImport, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.importUpdateSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), updateToImport, accept, requestOptions, Context.NONE); + return service.importUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), contentType, accept, updateToImport, requestOptions, Context.NONE); } /** - * Import new update version. This is a long-running-operation; use Operation-Location response header value to - * check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import new update version. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * [
      *      (Required){
      *         importManifest (Required): {
@@ -942,11 +984,13 @@ private Response importUpdateWithResponse(BinaryData updateToImport,
      *         ]
      *     }
      * ]
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -960,16 +1004,20 @@ private Response importUpdateWithResponse(BinaryData updateToImport,
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -986,10 +1034,216 @@ private Response importUpdateWithResponse(BinaryData updateToImport,
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param updateToImport The update to be imported (see schema - * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for details). + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of update metadata. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportUpdateWithModelAsync(BinaryData updateToImport, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.importUpdateWithResponseAsync(updateToImport, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class)); + } + + /** + * Import new update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + *

Request Body Schema

+ * + *
+     * {@code
+     * [
+     *      (Required){
+     *         importManifest (Required): {
+     *             url: String (Required)
+     *             sizeInBytes: long (Required)
+     *             hashes (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *         friendlyName: String (Optional)
+     *         files (Optional): [
+     *              (Optional){
+     *                 filename: String (Required)
+     *                 url: String (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     friendlyName: String (Optional)
+     *     isDeployable: Boolean (Optional)
+     *     updateType: String (Optional)
+     *     installedCriteria: String (Optional)
+     *     compatibility (Required): [
+     *          (Required){
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     instructions (Optional): {
+     *         steps (Required): [
+     *              (Required){
+     *                 type: String(inline/reference) (Optional)
+     *                 description: String (Optional)
+     *                 handler: String (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
+     *                 files (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 updateId (Optional): (recursive schema, see updateId above)
+     *             }
+     *         ]
+     *     }
+     *     referencedBy (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     scanResult: String (Optional)
+     *     manifestVersion: String (Required)
+     *     importedDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param updateToImport The update to be imported (see schema + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of update metadata. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportUpdateWithModel(BinaryData updateToImport, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.importUpdateWithResponse(updateToImport, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class)); + } + + /** + * Import new update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + *

Request Body Schema

+ * + *
+     * {@code
+     * [
+     *      (Required){
+     *         importManifest (Required): {
+     *             url: String (Required)
+     *             sizeInBytes: long (Required)
+     *             hashes (Required): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *         friendlyName: String (Optional)
+     *         files (Optional): [
+     *              (Optional){
+     *                 filename: String (Required)
+     *                 url: String (Required)
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     friendlyName: String (Optional)
+     *     isDeployable: Boolean (Optional)
+     *     updateType: String (Optional)
+     *     installedCriteria: String (Optional)
+     *     compatibility (Required): [
+     *          (Required){
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     instructions (Optional): {
+     *         steps (Required): [
+     *              (Required){
+     *                 type: String(inline/reference) (Optional)
+     *                 description: String (Optional)
+     *                 handler: String (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
+     *                 files (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 updateId (Optional): (recursive schema, see updateId above)
+     *             }
+     *         ]
+     *     }
+     *     referencedBy (Optional): [
+     *         (recursive schema, see above)
+     *     ]
+     *     scanResult: String (Optional)
+     *     manifestVersion: String (Required)
+     *     importedDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param updateToImport The update to be imported (see schema + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1002,21 +1256,22 @@ public PollerFlux beginImportUpdateAsync(BinaryData upda RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), () -> this.importUpdateWithResponseAsync(updateToImport, requestOptions), - new OperationResourcePollingStrategyWithEndpoint<>(this.client.getHttpPipeline(), - "https://" + this.client.getEndpoint(), null, null, - requestOptions != null && requestOptions.getContext() != null + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() - : Context.NONE), + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** - * Import new update version. This is a long-running-operation; use Operation-Location response header value to - * check for operation status. - * - *

Request Body Schema - * - *

{@code
+     * Import new update version. This is a long-running-operation; use
+     * Operation-Location response header value to check for operation status.
+     * 

Request Body Schema

+ * + *
+     * {@code
      * [
      *      (Required){
      *         importManifest (Required): {
@@ -1035,11 +1290,13 @@ public PollerFlux beginImportUpdateAsync(BinaryData upda
      *         ]
      *     }
      * ]
-     * }
- * - *

Response Body Schema - * - *

{@code
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -1053,16 +1310,20 @@ public PollerFlux beginImportUpdateAsync(BinaryData upda
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -1079,10 +1340,12 @@ public PollerFlux beginImportUpdateAsync(BinaryData upda
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param updateToImport The update to be imported (see schema - * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for details). + * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for + * details). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -1099,26 +1362,26 @@ public SyncPoller beginImportUpdate(BinaryData updateToI .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() - : Context.NONE)), + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** * Get a specific update version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -1132,16 +1395,20 @@ public SyncPoller beginImportUpdate(BinaryData updateToI
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -1158,8 +1425,9 @@ public SyncPoller beginImportUpdate(BinaryData updateToI
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1174,26 +1442,26 @@ public SyncPoller beginImportUpdate(BinaryData updateToI public Mono> getUpdateWithResponseAsync(String provider, String name, String version, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getUpdate(this.client.getEndpoint(), this.client.getInstanceId(), - provider, name, version, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getUpdate(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, accept, requestOptions, context)); } /** * Get a specific update version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -1207,16 +1475,20 @@ public Mono> getUpdateWithResponseAsync(String provider, St
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -1233,8 +1505,9 @@ public Mono> getUpdateWithResponseAsync(String provider, St
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1249,14 +1522,14 @@ public Mono> getUpdateWithResponseAsync(String provider, St public Response getUpdateWithResponse(String provider, String name, String version, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getUpdateSync(this.client.getEndpoint(), this.client.getInstanceId(), provider, name, version, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, accept, requestOptions, Context.NONE); } /** - * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value - * to check for operation status. - * + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1270,16 +1543,15 @@ public Response getUpdateWithResponse(String provider, String name, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteUpdateWithResponseAsync(String provider, String name, String version, RequestOptions requestOptions) { - final String accept = "application/json"; return FluxUtil.withContext( - context -> service.deleteUpdate(this.client.getEndpoint(), this.client.getInstanceId(), provider, name, - version, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + context -> service.deleteUpdate(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, requestOptions, context)); } /** - * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value - * to check for operation status. - * + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1293,15 +1565,14 @@ private Mono> deleteUpdateWithResponseAsync(String provider, Stri @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteUpdateWithResponse(String provider, String name, String version, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.deleteUpdateSync(this.client.getEndpoint(), this.client.getInstanceId(), provider, name, version, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.deleteUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, requestOptions, Context.NONE); } /** - * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value - * to check for operation status. - * + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1313,22 +1584,79 @@ private Response deleteUpdateWithResponse(String provider, String name, St * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginDeleteUpdateAsync(String provider, String name, String version, + public PollerFlux beginDeleteUpdateWithModelAsync(String provider, String name, + String version, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.deleteUpdateWithResponseAsync(provider, name, version, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteUpdateWithModel(String provider, String name, String version, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.deleteUpdateWithResponse(provider, name, version, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class)); + } + + /** + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteUpdateAsync(String provider, String name, String version, RequestOptions requestOptions) { return PollerFlux.create(Duration.ofSeconds(1), () -> this.deleteUpdateWithResponseAsync(provider, name, version, requestOptions), - new OperationResourcePollingStrategyWithEndpoint<>(this.client.getHttpPipeline(), - "https://" + this.client.getEndpoint(), null, null, - requestOptions != null && requestOptions.getContext() != null + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); } /** - * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value - * to check for operation status. - * + * Delete a specific update version. This is a long-running-operation; use + * Operation-Location response header value to check for operation status. + * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1340,7 +1668,7 @@ public PollerFlux beginDeleteUpdateAsync(String provider * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginDeleteUpdate(String provider, String name, String version, + public SyncPoller beginDeleteUpdate(String provider, String name, String version, RequestOptions requestOptions) { return SyncPoller.createPoller(Duration.ofSeconds(1), () -> this.deleteUpdateWithResponse(provider, name, version, requestOptions), @@ -1348,53 +1676,57 @@ public SyncPoller beginDeleteUpdate(String provider, Str .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint())) .setContext(requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() - : Context.NONE)), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + : Context.NONE) + .setServiceVersion(this.client.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class)); } /** - * Get a list of all update providers that have been imported to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Get a list of all update providers that have been imported to Device Update for
+     * IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update providers that have been imported to Device Update for IoT Hub along with {@link - * PagedResponse} on successful completion of {@link Mono}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listProvidersSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listProviders(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + return FluxUtil.withContext(context -> service.listProviders(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * Get a list of all update providers that have been imported to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Get a list of all update providers that have been imported to Device Update for
+     * IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update providers that have been imported to Device Update for IoT Hub as paginated response - * with {@link PagedFlux}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listProvidersAsync(RequestOptions requestOptions) { @@ -1406,47 +1738,52 @@ public PagedFlux listProvidersAsync(RequestOptions requestOptions) { } /** - * Get a list of all update providers that have been imported to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Get a list of all update providers that have been imported to Device Update for
+     * IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update providers that have been imported to Device Update for IoT Hub along with {@link - * PagedResponse}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listProvidersSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listProvidersSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res + = service.listProvidersSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * Get a list of all update providers that have been imported to Device Update for IoT Hub. - * - *

Response Body Schema - * - *

{@code
+     * Get a list of all update providers that have been imported to Device Update for
+     * IoT Hub.
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update providers that have been imported to Device Update for IoT Hub as paginated response - * with {@link PagedIterable}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listProviders(RequestOptions requestOptions) { @@ -1459,13 +1796,14 @@ public PagedIterable listProviders(RequestOptions requestOptions) { /** * Get a list of all update names that match the specified provider. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1473,35 +1811,37 @@ public PagedIterable listProviders(RequestOptions requestOptions) { * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all update names that match the specified provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNamesSinglePageAsync(String provider, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNames(this.client.getEndpoint(), this.client.getInstanceId(), provider, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext( + context -> service.listNames(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get a list of all update names that match the specified provider. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update names that match the specified provider as paginated response with {@link - * PagedFlux}. + * @return a list of all update names that match the specified provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listNamesAsync(String provider, RequestOptions requestOptions) { @@ -1514,13 +1854,14 @@ public PagedFlux listNamesAsync(String provider, RequestOptions requ /** * Get a list of all update names that match the specified provider. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1532,29 +1873,31 @@ public PagedFlux listNamesAsync(String provider, RequestOptions requ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNamesSinglePage(String provider, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listNamesSync(this.client.getEndpoint(), this.client.getInstanceId(), - provider, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res + = service.listNamesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get a list of all update names that match the specified provider. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update names that match the specified provider as paginated response with {@link - * PagedIterable}. + * @return a list of all update names that match the specified provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listNames(String provider, RequestOptions requestOptions) { @@ -1567,23 +1910,21 @@ public PagedIterable listNames(String provider, RequestOptions reque /** * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1592,38 +1933,37 @@ public PagedIterable listNames(String provider, RequestOptions reque * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all update versions that match the specified provider and name along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVersionsSinglePageAsync(String provider, String name, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listVersions(this.client.getEndpoint(), this.client.getInstanceId(), - provider, name, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext( + context -> service.listVersions(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1632,7 +1972,7 @@ private Mono> listVersionsSinglePageAsync(String provi * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all update versions that match the specified provider and name as paginated response with - * {@link PagedFlux}. + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listVersionsAsync(String provider, String name, RequestOptions requestOptions) { @@ -1645,23 +1985,21 @@ public PagedFlux listVersionsAsync(String provider, String name, Req /** * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1669,38 +2007,37 @@ public PagedFlux listVersionsAsync(String provider, String name, Req * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update versions that match the specified provider and name along with {@link - * PagedResponse}. + * @return a list of all update versions that match the specified provider and name along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVersionsSinglePage(String provider, String name, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listVersionsSync(this.client.getEndpoint(), this.client.getInstanceId(), - provider, name, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res + = service.listVersionsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * + *

Query Parameters

* - * - * - * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1709,7 +2046,7 @@ private PagedResponse listVersionsSinglePage(String provider, String * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all update versions that match the specified provider and name as paginated response with - * {@link PagedIterable}. + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { @@ -1722,13 +2059,14 @@ public PagedIterable listVersions(String provider, String name, Requ /** * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1738,28 +2076,30 @@ public PagedIterable listVersions(String provider, String name, Requ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all update file identifiers for the specified version along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listFilesSinglePageAsync(String provider, String name, String version, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listFiles(this.client.getEndpoint(), this.client.getInstanceId(), provider, - name, version, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .withContext( + context -> service.listFiles(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1768,8 +2108,8 @@ private Mono> listFilesSinglePageAsync(String provider * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update file identifiers for the specified version as paginated response with {@link - * PagedFlux}. + * @return a list of all update file identifiers for the specified version as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listFilesAsync(String provider, String name, String version, @@ -1783,13 +2123,14 @@ public PagedFlux listFilesAsync(String provider, String name, String /** * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1805,21 +2146,22 @@ private PagedResponse listFilesSinglePage(String provider, String na RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listFilesSync(this.client.getEndpoint(), this.client.getInstanceId(), provider, name, version, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + = service.listFilesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1828,8 +2170,8 @@ private PagedResponse listFilesSinglePage(String provider, String na * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a list of all update file identifiers for the specified version as paginated response with {@link - * PagedIterable}. + * @return a list of all update file identifiers for the specified version as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listFiles(String provider, String name, String version, @@ -1843,20 +2185,19 @@ public PagedIterable listFiles(String provider, String name, String /** * Get a specific update file from the version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     fileName: String (Required)
      *     sizeInBytes: long (Required)
@@ -1867,7 +2208,7 @@ public PagedIterable listFiles(String provider, String name, String
      *     scanResult: String (Optional)
      *     scanDetails: String (Optional)
      *     properties (Optional): {
-     *         String: String (Optional)
+     *         String: String (Required)
      *     }
      *     fileId: String (Required)
      *     relatedFiles (Optional): [
@@ -1881,7 +2222,7 @@ public PagedIterable listFiles(String provider, String name, String
      *             scanResult: String (Optional)
      *             scanDetails: String (Optional)
      *             properties (Optional): {
-     *                 String: String (Optional)
+     *                 String: String (Required)
      *             }
      *         }
      *     ]
@@ -1890,8 +2231,9 @@ public PagedIterable listFiles(String provider, String name, String
      *     }
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1901,34 +2243,33 @@ public PagedIterable listFiles(String provider, String name, String * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a specific update file from the version along with {@link Response} on successful completion of {@link - * Mono}. + * @return a specific update file from the version along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getFileWithResponseAsync(String provider, String name, String version, String fileId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getFile(this.client.getEndpoint(), this.client.getInstanceId(), provider, - name, version, fileId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getFile(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, fileId, accept, requestOptions, context)); } /** * Get a specific update file from the version. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     fileName: String (Required)
      *     sizeInBytes: long (Required)
@@ -1939,7 +2280,7 @@ public Mono> getFileWithResponseAsync(String provider, Stri
      *     scanResult: String (Optional)
      *     scanDetails: String (Optional)
      *     properties (Optional): {
-     *         String: String (Optional)
+     *         String: String (Required)
      *     }
      *     fileId: String (Required)
      *     relatedFiles (Optional): [
@@ -1953,7 +2294,7 @@ public Mono> getFileWithResponseAsync(String provider, Stri
      *             scanResult: String (Optional)
      *             scanDetails: String (Optional)
      *             properties (Optional): {
-     *                 String: String (Optional)
+     *                 String: String (Required)
      *             }
      *         }
      *     ]
@@ -1962,8 +2303,9 @@ public Mono> getFileWithResponseAsync(String provider, Stri
      *     }
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param provider Update provider. * @param name Update name. * @param version Update version. @@ -1979,28 +2321,31 @@ public Mono> getFileWithResponseAsync(String provider, Stri public Response getFileWithResponse(String provider, String name, String version, String fileId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getFileSync(this.client.getEndpoint(), this.client.getInstanceId(), provider, name, version, - fileId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getFileSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), provider, name, version, fileId, accept, requestOptions, Context.NONE); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one + * specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2034,45 +2379,47 @@ public Response getFileWithResponse(String provider, String name, St
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of all import update operations along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationStatusesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listOperationStatuses(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + return FluxUtil.withContext(context -> service.listOperationStatuses(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one + * specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2106,8 +2453,9 @@ private Mono> listOperationStatusesSinglePageAsync(Req
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2125,23 +2473,26 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one + * specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2175,8 +2526,9 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2188,30 +2540,33 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp private PagedResponse listOperationStatusesSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listOperationStatusesSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + = service.listOperationStatusesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } /** - * 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. - * - *

Query Parameters - * + * 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. + *

Query Parameters

* - * - * - * - * + * + * + * + * *
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
Query Parameters
NameTypeRequiredDescription
filterStringNoOptional to filter operations by status property. Only one + * specific filter is + * supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items + * returned + * from a collection. The service returns the number of available items up to but + * not greater than the specified value n.
- * * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2245,8 +2600,9 @@ private PagedResponse listOperationStatusesSinglePage(RequestOptions
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -2265,20 +2621,19 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2312,8 +2667,9 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2326,27 +2682,26 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt public Mono> getOperationStatusWithResponseAsync(String operationId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getOperationStatus(this.client.getEndpoint(), this.client.getInstanceId(), - operationId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getOperationStatus(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), this.client.getInstanceId(), operationId, accept, + requestOptions, context)); } /** * Retrieve operation status. - * - *

Header Parameters - * + *

Header Parameters

* - * - * - * + * + * + * *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will + * be performed only if + * the ETag on the server does not match this value.
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2380,8 +2735,9 @@ public Mono> getOperationStatusWithResponseAsync(String ope
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * + * } + *
+ * * @param operationId Operation identifier. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -2393,16 +2749,16 @@ public Mono> getOperationStatusWithResponseAsync(String ope @ServiceMethod(returns = ReturnType.SINGLE) public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getInstanceId(), operationId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + this.client.getInstanceId(), operationId, accept, requestOptions, Context.NONE); } /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -2416,16 +2772,20 @@ public Response getOperationStatusWithResponse(String operationId, R
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -2442,16 +2802,17 @@ public Response getOperationStatusWithResponse(String operationId, R
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of updates along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of all updates that have been imported to Device Update for IoT Hub along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listUpdatesNextSinglePageAsync(String nextLink, @@ -2465,10 +2826,10 @@ private Mono> listUpdatesNextSinglePageAsync(String ne /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     updateId (Required): {
      *         provider: String (Required)
@@ -2482,16 +2843,20 @@ private Mono> listUpdatesNextSinglePageAsync(String ne
      *     installedCriteria: String (Optional)
      *     compatibility (Required): [
      *          (Required){
-     *             String: String (Required)
+     *              (Optional): {
+     *                 String: String (Required)
+     *             }
      *         }
      *     ]
      *     instructions (Optional): {
      *         steps (Required): [
      *              (Required){
-     *                 type: String(Inline/Reference) (Optional)
+     *                 type: String(inline/reference) (Optional)
      *                 description: String (Optional)
      *                 handler: String (Optional)
-     *                 handlerProperties: Object (Optional)
+     *                 handlerProperties (Optional): {
+     *                     String: BinaryData (Required)
+     *                 }
      *                 files (Optional): [
      *                     String (Optional)
      *                 ]
@@ -2508,16 +2873,17 @@ private Mono> listUpdatesNextSinglePageAsync(String ne
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of updates along with {@link PagedResponse}. + * @return a list of all updates that have been imported to Device Update for IoT Hub along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listUpdatesNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -2530,22 +2896,22 @@ private PagedResponse listUpdatesNextSinglePage(String nextLink, Req /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listProvidersNextSinglePageAsync(String nextLink, @@ -2559,21 +2925,22 @@ private Mono> listProvidersNextSinglePageAsync(String /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse}. + * @return a list of all update providers that have been imported to Device Update for + * IoT Hub along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listProvidersNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -2586,22 +2953,22 @@ private PagedResponse listProvidersNextSinglePage(String nextLink, R /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of all update names that match the specified provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNamesNextSinglePageAsync(String nextLink, @@ -2616,21 +2983,21 @@ private Mono> listNamesNextSinglePageAsync(String next /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse}. + * @return a list of all update names that match the specified provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNamesNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -2643,22 +3010,22 @@ private PagedResponse listNamesNextSinglePage(String nextLink, Reque /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of all update versions that match the specified provider and name along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listVersionsNextSinglePageAsync(String nextLink, @@ -2672,21 +3039,22 @@ private Mono> listVersionsNextSinglePageAsync(String n /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse}. + * @return a list of all update versions that match the specified provider and name along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listVersionsNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -2699,22 +3067,22 @@ private PagedResponse listVersionsNextSinglePage(String nextLink, Re /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return a list of all update file identifiers for the specified version along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listFilesNextSinglePageAsync(String nextLink, @@ -2729,21 +3097,21 @@ private Mono> listFilesNextSinglePageAsync(String next /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * String
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of strings with server paging support along with {@link PagedResponse}. + * @return a list of all update file identifiers for the specified version along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listFilesNextSinglePage(String nextLink, RequestOptions requestOptions) { @@ -2756,10 +3124,10 @@ private PagedResponse listFilesNextSinglePage(String nextLink, Reque /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2793,17 +3161,17 @@ private PagedResponse listFilesNextSinglePage(String nextLink, Reque
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of operations with server paging support along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of all import update operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listOperationStatusesNextSinglePageAsync(String nextLink, @@ -2818,10 +3186,10 @@ private Mono> listOperationStatusesNextSinglePageAsync /** * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     operationId: String (Required)
      *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
@@ -2855,16 +3223,16 @@ private Mono> listOperationStatusesNextSinglePageAsync
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * } + *

+ * + * @param nextLink The URL to get the next list of items. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of operations with server paging support along with {@link PagedResponse}. + * @return a list of all import update operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listOperationStatusesNextSinglePage(String nextLink, diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/JsonMergePatchHelper.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/JsonMergePatchHelper.java new file mode 100644 index 000000000000..e515a89d03fc --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/JsonMergePatchHelper.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.implementation; + +import com.azure.iot.deviceupdate.models.PatchBody; + +/** + * This is the Helper class to enable json merge patch serialization for a model. + */ +public class JsonMergePatchHelper { + private static PatchBodyAccessor patchBodyAccessor; + + public interface PatchBodyAccessor { + PatchBody prepareModelForJsonMergePatch(PatchBody patchBody, boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(PatchBody patchBody); + } + + public static void setPatchBodyAccessor(PatchBodyAccessor accessor) { + patchBodyAccessor = accessor; + } + + public static PatchBodyAccessor getPatchBodyAccessor() { + return patchBodyAccessor; + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java index e799b0f50b88..976989b26b26 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for 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. + * Package containing the implementations for 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. */ package com.azure.iot.deviceupdate.implementation; diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicy.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicy.java new file mode 100644 index 000000000000..e50272b3286a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicy.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Rollback policy for deployment. + */ +@Immutable +public final class CloudInitiatedRollbackPolicy implements JsonSerializable { + /* + * Update to rollback to. + */ + @Generated + private final UpdateInfo update; + + /* + * Failure conditions to initiate rollback policy. + */ + @Generated + private final CloudInitiatedRollbackPolicyFailure failure; + + /** + * Creates an instance of CloudInitiatedRollbackPolicy class. + * + * @param update the update value to set. + * @param failure the failure value to set. + */ + @Generated + public CloudInitiatedRollbackPolicy(UpdateInfo update, CloudInitiatedRollbackPolicyFailure failure) { + this.update = update; + this.failure = failure; + } + + /** + * Get the update property: Update to rollback to. + * + * @return the update value. + */ + @Generated + public UpdateInfo getUpdate() { + return this.update; + } + + /** + * Get the failure property: Failure conditions to initiate rollback policy. + * + * @return the failure value. + */ + @Generated + public CloudInitiatedRollbackPolicyFailure getFailure() { + return this.failure; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("update", this.update); + jsonWriter.writeJsonField("failure", this.failure); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudInitiatedRollbackPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudInitiatedRollbackPolicy if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudInitiatedRollbackPolicy. + */ + @Generated + public static CloudInitiatedRollbackPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateInfo update = null; + CloudInitiatedRollbackPolicyFailure failure = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("update".equals(fieldName)) { + update = UpdateInfo.fromJson(reader); + } else if ("failure".equals(fieldName)) { + failure = CloudInitiatedRollbackPolicyFailure.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new CloudInitiatedRollbackPolicy(update, failure); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicyFailure.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicyFailure.java new file mode 100644 index 000000000000..9283c9955ce2 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicyFailure.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Failure conditions to initiate rollback policy. + */ +@Immutable +public final class CloudInitiatedRollbackPolicyFailure + implements JsonSerializable { + /* + * Percentage of devices that failed. + */ + @Generated + private final int devicesFailedPercentage; + + /* + * Number of devices that failed. + */ + @Generated + private final int devicesFailedCount; + + /** + * Creates an instance of CloudInitiatedRollbackPolicyFailure class. + * + * @param devicesFailedPercentage the devicesFailedPercentage value to set. + * @param devicesFailedCount the devicesFailedCount value to set. + */ + @Generated + public CloudInitiatedRollbackPolicyFailure(int devicesFailedPercentage, int devicesFailedCount) { + this.devicesFailedPercentage = devicesFailedPercentage; + this.devicesFailedCount = devicesFailedCount; + } + + /** + * Get the devicesFailedPercentage property: Percentage of devices that failed. + * + * @return the devicesFailedPercentage value. + */ + @Generated + public int getDevicesFailedPercentage() { + return this.devicesFailedPercentage; + } + + /** + * Get the devicesFailedCount property: Number of devices that failed. + * + * @return the devicesFailedCount value. + */ + @Generated + public int getDevicesFailedCount() { + return this.devicesFailedCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("devicesFailedPercentage", this.devicesFailedPercentage); + jsonWriter.writeIntField("devicesFailedCount", this.devicesFailedCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudInitiatedRollbackPolicyFailure from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudInitiatedRollbackPolicyFailure if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudInitiatedRollbackPolicyFailure. + */ + @Generated + public static CloudInitiatedRollbackPolicyFailure fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int devicesFailedPercentage = 0; + int devicesFailedCount = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("devicesFailedPercentage".equals(fieldName)) { + devicesFailedPercentage = reader.getInt(); + } else if ("devicesFailedCount".equals(fieldName)) { + devicesFailedCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new CloudInitiatedRollbackPolicyFailure(devicesFailedPercentage, devicesFailedCount); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Compatibility.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Compatibility.java new file mode 100644 index 000000000000..e21d4e07626b --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Compatibility.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Key-value pairs representing update compatibility information. + */ +@Immutable +public final class Compatibility implements JsonSerializable { + /* + * Key-value pairs representing update compatibility information. + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of Compatibility class. + */ + @Generated + private Compatibility() { + } + + /** + * Get the additionalProperties property: Key-value pairs representing update compatibility information. + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Compatibility from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Compatibility if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Compatibility. + */ + @Generated + public static Compatibility fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Compatibility deserializedCompatibility = new Compatibility(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.getString()); + } + deserializedCompatibility.additionalProperties = additionalProperties; + + return deserializedCompatibility; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ContractModel.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ContractModel.java new file mode 100644 index 000000000000..028e0beaa2d0 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ContractModel.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Device Update agent contract model. + */ +@Immutable +public final class ContractModel implements JsonSerializable { + /* + * The Device Update agent contract model Id of the device class. This is also + * used to calculate the device class Id. + */ + @Generated + private final String id; + + /* + * The Device Update agent contract model name of the device class. Intended to be + * a more readable form of the contract model Id. + */ + @Generated + private final String name; + + /** + * Creates an instance of ContractModel class. + * + * @param id the id value to set. + * @param name the name value to set. + */ + @Generated + private ContractModel(String id, String name) { + this.id = id; + this.name = name; + } + + /** + * Get the id property: The Device Update agent contract model Id of the device class. This is also + * used to calculate the device class Id. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The Device Update agent contract model name of the device class. Intended to be + * a more readable form of the contract model Id. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ContractModel from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ContractModel if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ContractModel. + */ + @Generated + public static ContractModel fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ContractModel(id, name); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Deployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Deployment.java new file mode 100644 index 000000000000..c946d2147e53 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Deployment.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Deployment metadata. + */ +@Fluent +public final class Deployment implements JsonSerializable { + /* + * 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. + */ + @Generated + private final String deploymentId; + + /* + * The deployment start datetime. + */ + @Generated + private final OffsetDateTime startDateTime; + + /* + * Update information for the update in the deployment. + */ + @Generated + private final UpdateInfo update; + + /* + * The group identity for the devices the deployment is intended to update. + */ + @Generated + private final String groupId; + + /* + * 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 + */ + @Generated + private List deviceClassSubgroups; + + /* + * Boolean flag indicating whether the deployment was canceled. + */ + @Generated + private Boolean isCanceled; + + /* + * Boolean flag indicating whether the deployment has been retried. + */ + @Generated + private Boolean isRetried; + + /* + * The rollback policy for the deployment. + */ + @Generated + private CloudInitiatedRollbackPolicy rollbackPolicy; + + /* + * Boolean flag indicating whether the deployment is a rollback deployment. + */ + @Generated + private Boolean isCloudInitiatedRollback; + + /* + * The protocol the device should use when downloading the update payload. + * Defaults to "https". + */ + @Generated + private DownloadSecurity downloadSecurity; + + /** + * Creates an instance of Deployment class. + * + * @param deploymentId the deploymentId value to set. + * @param startDateTime the startDateTime value to set. + * @param update the update value to set. + * @param groupId the groupId value to set. + */ + @Generated + public Deployment(String deploymentId, OffsetDateTime startDateTime, UpdateInfo update, String groupId) { + this.deploymentId = deploymentId; + this.startDateTime = startDateTime; + this.update = update; + this.groupId = groupId; + } + + /** + * Get the deploymentId property: 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. + * + * @return the deploymentId value. + */ + @Generated + public String getDeploymentId() { + return this.deploymentId; + } + + /** + * Get the startDateTime property: The deployment start datetime. + * + * @return the startDateTime value. + */ + @Generated + public OffsetDateTime getStartDateTime() { + return this.startDateTime; + } + + /** + * Get the update property: Update information for the update in the deployment. + * + * @return the update value. + */ + @Generated + public UpdateInfo getUpdate() { + return this.update; + } + + /** + * Get the groupId property: The group identity for the devices the deployment is intended to update. + * + * @return the groupId value. + */ + @Generated + public String getGroupId() { + return this.groupId; + } + + /** + * Get the deviceClassSubgroups property: 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. + * + * @return the deviceClassSubgroups value. + */ + @Generated + public List getDeviceClassSubgroups() { + return this.deviceClassSubgroups; + } + + /** + * Set the deviceClassSubgroups property: 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. + * + * @param deviceClassSubgroups the deviceClassSubgroups value to set. + * @return the Deployment object itself. + */ + @Generated + public Deployment setDeviceClassSubgroups(List deviceClassSubgroups) { + this.deviceClassSubgroups = deviceClassSubgroups; + return this; + } + + /** + * Get the isCanceled property: Boolean flag indicating whether the deployment was canceled. + * + * @return the isCanceled value. + */ + @Generated + public Boolean isCanceled() { + return this.isCanceled; + } + + /** + * Set the isCanceled property: Boolean flag indicating whether the deployment was canceled. + * + * @param isCanceled the isCanceled value to set. + * @return the Deployment object itself. + */ + @Generated + public Deployment setIsCanceled(Boolean isCanceled) { + this.isCanceled = isCanceled; + return this; + } + + /** + * Get the isRetried property: Boolean flag indicating whether the deployment has been retried. + * + * @return the isRetried value. + */ + @Generated + public Boolean isRetried() { + return this.isRetried; + } + + /** + * Set the isRetried property: Boolean flag indicating whether the deployment has been retried. + * + * @param isRetried the isRetried value to set. + * @return the Deployment object itself. + */ + @Generated + public Deployment setIsRetried(Boolean isRetried) { + this.isRetried = isRetried; + return this; + } + + /** + * Get the rollbackPolicy property: The rollback policy for the deployment. + * + * @return the rollbackPolicy value. + */ + @Generated + public CloudInitiatedRollbackPolicy getRollbackPolicy() { + return this.rollbackPolicy; + } + + /** + * Set the rollbackPolicy property: The rollback policy for the deployment. + * + * @param rollbackPolicy the rollbackPolicy value to set. + * @return the Deployment object itself. + */ + @Generated + public Deployment setRollbackPolicy(CloudInitiatedRollbackPolicy rollbackPolicy) { + this.rollbackPolicy = rollbackPolicy; + return this; + } + + /** + * Get the isCloudInitiatedRollback property: Boolean flag indicating whether the deployment is a rollback + * deployment. + * + * @return the isCloudInitiatedRollback value. + */ + @Generated + public Boolean isCloudInitiatedRollback() { + return this.isCloudInitiatedRollback; + } + + /** + * Set the isCloudInitiatedRollback property: Boolean flag indicating whether the deployment is a rollback + * deployment. + * + * @param isCloudInitiatedRollback the isCloudInitiatedRollback value to set. + * @return the Deployment object itself. + */ + @Generated + public Deployment setIsCloudInitiatedRollback(Boolean isCloudInitiatedRollback) { + this.isCloudInitiatedRollback = isCloudInitiatedRollback; + return this; + } + + /** + * Get the downloadSecurity property: The protocol the device should use when downloading the update payload. + * Defaults to "https". + * + * @return the downloadSecurity value. + */ + @Generated + public DownloadSecurity getDownloadSecurity() { + return this.downloadSecurity; + } + + /** + * Set the downloadSecurity property: The protocol the device should use when downloading the update payload. + * Defaults to "https". + * + * @param downloadSecurity the downloadSecurity value to set. + * @return the Deployment object itself. + */ + @Generated + public Deployment setDownloadSecurity(DownloadSecurity downloadSecurity) { + this.downloadSecurity = downloadSecurity; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + jsonWriter.writeStringField("startDateTime", + this.startDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startDateTime)); + jsonWriter.writeJsonField("update", this.update); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeArrayField("deviceClassSubgroups", this.deviceClassSubgroups, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isCanceled", this.isCanceled); + jsonWriter.writeBooleanField("isRetried", this.isRetried); + jsonWriter.writeJsonField("rollbackPolicy", this.rollbackPolicy); + jsonWriter.writeBooleanField("isCloudInitiatedRollback", this.isCloudInitiatedRollback); + jsonWriter.writeStringField("downloadSecurity", + this.downloadSecurity == null ? null : this.downloadSecurity.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Deployment from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Deployment if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Deployment. + */ + @Generated + public static Deployment fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deploymentId = null; + OffsetDateTime startDateTime = null; + UpdateInfo update = null; + String groupId = null; + List deviceClassSubgroups = null; + Boolean isCanceled = null; + Boolean isRetried = null; + CloudInitiatedRollbackPolicy rollbackPolicy = null; + Boolean isCloudInitiatedRollback = null; + DownloadSecurity downloadSecurity = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deploymentId".equals(fieldName)) { + deploymentId = reader.getString(); + } else if ("startDateTime".equals(fieldName)) { + startDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("update".equals(fieldName)) { + update = UpdateInfo.fromJson(reader); + } else if ("groupId".equals(fieldName)) { + groupId = reader.getString(); + } else if ("deviceClassSubgroups".equals(fieldName)) { + deviceClassSubgroups = reader.readArray(reader1 -> reader1.getString()); + } else if ("isCanceled".equals(fieldName)) { + isCanceled = reader.getNullable(JsonReader::getBoolean); + } else if ("isRetried".equals(fieldName)) { + isRetried = reader.getNullable(JsonReader::getBoolean); + } else if ("rollbackPolicy".equals(fieldName)) { + rollbackPolicy = CloudInitiatedRollbackPolicy.fromJson(reader); + } else if ("isCloudInitiatedRollback".equals(fieldName)) { + isCloudInitiatedRollback = reader.getNullable(JsonReader::getBoolean); + } else if ("downloadSecurity".equals(fieldName)) { + downloadSecurity = DownloadSecurity.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + Deployment deserializedDeployment = new Deployment(deploymentId, startDateTime, update, groupId); + deserializedDeployment.deviceClassSubgroups = deviceClassSubgroups; + deserializedDeployment.isCanceled = isCanceled; + deserializedDeployment.isRetried = isRetried; + deserializedDeployment.rollbackPolicy = rollbackPolicy; + deserializedDeployment.isCloudInitiatedRollback = isCloudInitiatedRollback; + deserializedDeployment.downloadSecurity = downloadSecurity; + + return deserializedDeployment; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentDeviceState.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentDeviceState.java new file mode 100644 index 000000000000..9fc9015e85c3 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentDeviceState.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Deployment device status. + */ +@Immutable +public final class DeploymentDeviceState implements JsonSerializable { + /* + * Device identity. + */ + @Generated + private final String deviceId; + + /* + * Device module identity. + */ + @Generated + private String moduleId; + + /* + * The number of times this deployment has been retried on this device. + */ + @Generated + private final int retryCount; + + /* + * Boolean flag indicating whether this device is in a newer deployment and can no + * longer retry this deployment. + */ + @Generated + private final boolean movedOnToNewDeployment; + + /* + * Deployment device state. + */ + @Generated + private final DeviceDeploymentState deviceState; + + /** + * Creates an instance of DeploymentDeviceState class. + * + * @param deviceId the deviceId value to set. + * @param retryCount the retryCount value to set. + * @param movedOnToNewDeployment the movedOnToNewDeployment value to set. + * @param deviceState the deviceState value to set. + */ + @Generated + private DeploymentDeviceState(String deviceId, int retryCount, boolean movedOnToNewDeployment, + DeviceDeploymentState deviceState) { + this.deviceId = deviceId; + this.retryCount = retryCount; + this.movedOnToNewDeployment = movedOnToNewDeployment; + this.deviceState = deviceState; + } + + /** + * Get the deviceId property: Device identity. + * + * @return the deviceId value. + */ + @Generated + public String getDeviceId() { + return this.deviceId; + } + + /** + * Get the moduleId property: Device module identity. + * + * @return the moduleId value. + */ + @Generated + public String getModuleId() { + return this.moduleId; + } + + /** + * Get the retryCount property: The number of times this deployment has been retried on this device. + * + * @return the retryCount value. + */ + @Generated + public int getRetryCount() { + return this.retryCount; + } + + /** + * Get the movedOnToNewDeployment property: Boolean flag indicating whether this device is in a newer deployment and + * can no + * longer retry this deployment. + * + * @return the movedOnToNewDeployment value. + */ + @Generated + public boolean isMovedOnToNewDeployment() { + return this.movedOnToNewDeployment; + } + + /** + * Get the deviceState property: Deployment device state. + * + * @return the deviceState value. + */ + @Generated + public DeviceDeploymentState getDeviceState() { + return this.deviceState; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceId", this.deviceId); + jsonWriter.writeIntField("retryCount", this.retryCount); + jsonWriter.writeBooleanField("movedOnToNewDeployment", this.movedOnToNewDeployment); + jsonWriter.writeStringField("deviceState", this.deviceState == null ? null : this.deviceState.toString()); + jsonWriter.writeStringField("moduleId", this.moduleId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentDeviceState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentDeviceState if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeploymentDeviceState. + */ + @Generated + public static DeploymentDeviceState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deviceId = null; + int retryCount = 0; + boolean movedOnToNewDeployment = false; + DeviceDeploymentState deviceState = null; + String moduleId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceId".equals(fieldName)) { + deviceId = reader.getString(); + } else if ("retryCount".equals(fieldName)) { + retryCount = reader.getInt(); + } else if ("movedOnToNewDeployment".equals(fieldName)) { + movedOnToNewDeployment = reader.getBoolean(); + } else if ("deviceState".equals(fieldName)) { + deviceState = DeviceDeploymentState.fromString(reader.getString()); + } else if ("moduleId".equals(fieldName)) { + moduleId = reader.getString(); + } else { + reader.skipChildren(); + } + } + DeploymentDeviceState deserializedDeploymentDeviceState + = new DeploymentDeviceState(deviceId, retryCount, movedOnToNewDeployment, deviceState); + deserializedDeploymentDeviceState.moduleId = moduleId; + + return deserializedDeploymentDeviceState; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentState.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentState.java new file mode 100644 index 000000000000..3bce57c6fa49 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentState.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Deployment state. + */ +public final class DeploymentState extends ExpandableStringEnum { + /** + * The deployment can be sent to devices targeted in the deployment. + */ + @Generated + public static final DeploymentState ACTIVE = fromString("Active"); + + /** + * The deployment can be sent to some devices targeted in the deployment but at + * least 1 subgroup is in a failed state. + */ + @Generated + public static final DeploymentState ACTIVE_WITH_SUBGROUP_FAILURES = fromString("ActiveWithSubgroupFailures"); + + /** + * The deployment will not be sent to any devices. Consult error for more details + * about what failed. + */ + @Generated + public static final DeploymentState FAILED = fromString("Failed"); + + /** + * A newer deployment for this group has been created and no devices in the group + * will receive this deployment. + */ + @Generated + public static final DeploymentState INACTIVE = fromString("Inactive"); + + /** + * The deployment has been canceled and no devices will receive it. + */ + @Generated + public static final DeploymentState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of DeploymentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DeploymentState() { + } + + /** + * Creates or finds a DeploymentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeploymentState. + */ + @Generated + public static DeploymentState fromString(String name) { + return fromString(name, DeploymentState.class); + } + + /** + * Gets known DeploymentState values. + * + * @return known DeploymentState values. + */ + @Generated + public static Collection values() { + return values(DeploymentState.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentStatus.java new file mode 100644 index 000000000000..978a6aec994f --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeploymentStatus.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Deployment status metadata. + */ +@Immutable +public final class DeploymentStatus implements JsonSerializable { + /* + * The group identity + */ + @Generated + private final String groupId; + + /* + * The state of the deployment. + */ + @Generated + private final DeploymentState deploymentState; + + /* + * The error details of the Failed state. This is not present if the deployment + * state is not Failed. + */ + @Generated + private Error error; + + /* + * The collection of device class subgroup status objects + */ + @Generated + private final List subgroupStatus; + + /** + * Creates an instance of DeploymentStatus class. + * + * @param groupId the groupId value to set. + * @param deploymentState the deploymentState value to set. + * @param subgroupStatus the subgroupStatus value to set. + */ + @Generated + private DeploymentStatus(String groupId, DeploymentState deploymentState, + List subgroupStatus) { + this.groupId = groupId; + this.deploymentState = deploymentState; + this.subgroupStatus = subgroupStatus; + } + + /** + * Get the groupId property: The group identity. + * + * @return the groupId value. + */ + @Generated + public String getGroupId() { + return this.groupId; + } + + /** + * Get the deploymentState property: The state of the deployment. + * + * @return the deploymentState value. + */ + @Generated + public DeploymentState getDeploymentState() { + return this.deploymentState; + } + + /** + * Get the error property: The error details of the Failed state. This is not present if the deployment + * state is not Failed. + * + * @return the error value. + */ + @Generated + public Error getError() { + return this.error; + } + + /** + * Get the subgroupStatus property: The collection of device class subgroup status objects. + * + * @return the subgroupStatus value. + */ + @Generated + public List getSubgroupStatus() { + return this.subgroupStatus; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("deploymentState", + this.deploymentState == null ? null : this.deploymentState.toString()); + jsonWriter.writeArrayField("subgroupStatus", this.subgroupStatus, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeploymentStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeploymentStatus if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeploymentStatus. + */ + @Generated + public static DeploymentStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String groupId = null; + DeploymentState deploymentState = null; + List subgroupStatus = null; + Error error = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + groupId = reader.getString(); + } else if ("deploymentState".equals(fieldName)) { + deploymentState = DeploymentState.fromString(reader.getString()); + } else if ("subgroupStatus".equals(fieldName)) { + subgroupStatus = reader.readArray(reader1 -> DeviceClassSubgroupDeploymentStatus.fromJson(reader1)); + } else if ("error".equals(fieldName)) { + error = Error.fromJson(reader); + } else { + reader.skipChildren(); + } + } + DeploymentStatus deserializedDeploymentStatus + = new DeploymentStatus(groupId, deploymentState, subgroupStatus); + deserializedDeploymentStatus.error = error; + + return deserializedDeploymentStatus; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Device.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Device.java new file mode 100644 index 000000000000..5d279b2dd4c9 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Device.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Device metadata. + */ +@Immutable +public final class Device implements JsonSerializable { + /* + * Device identity. + */ + @Generated + private final String deviceId; + + /* + * Device module identity. + */ + @Generated + private String moduleId; + + /* + * Device class identity. + */ + @Generated + private final String deviceClassId; + + /* + * Device group identity. + */ + @Generated + private String groupId; + + /* + * The update that device last attempted to install. + */ + @Generated + private UpdateInfo lastAttemptedUpdate; + + /* + * State of the device in its last deployment. + */ + @Generated + private DeviceDeploymentState deploymentStatus; + + /* + * Currently installed update on device. + */ + @Generated + private UpdateInfo installedUpdate; + + /* + * Boolean flag indicating whether the latest update (the best compatible update + * for the device's device class and group) is installed on the device + */ + @Generated + private final boolean onLatestUpdate; + + /* + * The deployment identifier for the last deployment to the device + */ + @Generated + private String lastDeploymentId; + + /* + * Last install result. + */ + @Generated + private InstallResult lastInstallResult; + + /** + * Creates an instance of Device class. + * + * @param deviceId the deviceId value to set. + * @param deviceClassId the deviceClassId value to set. + * @param onLatestUpdate the onLatestUpdate value to set. + */ + @Generated + private Device(String deviceId, String deviceClassId, boolean onLatestUpdate) { + this.deviceId = deviceId; + this.deviceClassId = deviceClassId; + this.onLatestUpdate = onLatestUpdate; + } + + /** + * Get the deviceId property: Device identity. + * + * @return the deviceId value. + */ + @Generated + public String getDeviceId() { + return this.deviceId; + } + + /** + * Get the moduleId property: Device module identity. + * + * @return the moduleId value. + */ + @Generated + public String getModuleId() { + return this.moduleId; + } + + /** + * Get the deviceClassId property: Device class identity. + * + * @return the deviceClassId value. + */ + @Generated + public String getDeviceClassId() { + return this.deviceClassId; + } + + /** + * Get the groupId property: Device group identity. + * + * @return the groupId value. + */ + @Generated + public String getGroupId() { + return this.groupId; + } + + /** + * Get the lastAttemptedUpdate property: The update that device last attempted to install. + * + * @return the lastAttemptedUpdate value. + */ + @Generated + public UpdateInfo getLastAttemptedUpdate() { + return this.lastAttemptedUpdate; + } + + /** + * Get the deploymentStatus property: State of the device in its last deployment. + * + * @return the deploymentStatus value. + */ + @Generated + public DeviceDeploymentState getDeploymentStatus() { + return this.deploymentStatus; + } + + /** + * Get the installedUpdate property: Currently installed update on device. + * + * @return the installedUpdate value. + */ + @Generated + public UpdateInfo getInstalledUpdate() { + return this.installedUpdate; + } + + /** + * Get the onLatestUpdate property: Boolean flag indicating whether the latest update (the best compatible update + * for the device's device class and group) is installed on the device. + * + * @return the onLatestUpdate value. + */ + @Generated + public boolean isOnLatestUpdate() { + return this.onLatestUpdate; + } + + /** + * Get the lastDeploymentId property: The deployment identifier for the last deployment to the device. + * + * @return the lastDeploymentId value. + */ + @Generated + public String getLastDeploymentId() { + return this.lastDeploymentId; + } + + /** + * Get the lastInstallResult property: Last install result. + * + * @return the lastInstallResult value. + */ + @Generated + public InstallResult getLastInstallResult() { + return this.lastInstallResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceId", this.deviceId); + jsonWriter.writeStringField("deviceClassId", this.deviceClassId); + jsonWriter.writeBooleanField("onLatestUpdate", this.onLatestUpdate); + jsonWriter.writeStringField("moduleId", this.moduleId); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeJsonField("lastAttemptedUpdate", this.lastAttemptedUpdate); + jsonWriter.writeStringField("deploymentStatus", + this.deploymentStatus == null ? null : this.deploymentStatus.toString()); + jsonWriter.writeJsonField("installedUpdate", this.installedUpdate); + jsonWriter.writeStringField("lastDeploymentId", this.lastDeploymentId); + jsonWriter.writeJsonField("lastInstallResult", this.lastInstallResult); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Device from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Device if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Device. + */ + @Generated + public static Device fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deviceId = null; + String deviceClassId = null; + boolean onLatestUpdate = false; + String moduleId = null; + String groupId = null; + UpdateInfo lastAttemptedUpdate = null; + DeviceDeploymentState deploymentStatus = null; + UpdateInfo installedUpdate = null; + String lastDeploymentId = null; + InstallResult lastInstallResult = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceId".equals(fieldName)) { + deviceId = reader.getString(); + } else if ("deviceClassId".equals(fieldName)) { + deviceClassId = reader.getString(); + } else if ("onLatestUpdate".equals(fieldName)) { + onLatestUpdate = reader.getBoolean(); + } else if ("moduleId".equals(fieldName)) { + moduleId = reader.getString(); + } else if ("groupId".equals(fieldName)) { + groupId = reader.getString(); + } else if ("lastAttemptedUpdate".equals(fieldName)) { + lastAttemptedUpdate = UpdateInfo.fromJson(reader); + } else if ("deploymentStatus".equals(fieldName)) { + deploymentStatus = DeviceDeploymentState.fromString(reader.getString()); + } else if ("installedUpdate".equals(fieldName)) { + installedUpdate = UpdateInfo.fromJson(reader); + } else if ("lastDeploymentId".equals(fieldName)) { + lastDeploymentId = reader.getString(); + } else if ("lastInstallResult".equals(fieldName)) { + lastInstallResult = InstallResult.fromJson(reader); + } else { + reader.skipChildren(); + } + } + Device deserializedDevice = new Device(deviceId, deviceClassId, onLatestUpdate); + deserializedDevice.moduleId = moduleId; + deserializedDevice.groupId = groupId; + deserializedDevice.lastAttemptedUpdate = lastAttemptedUpdate; + deserializedDevice.deploymentStatus = deploymentStatus; + deserializedDevice.installedUpdate = installedUpdate; + deserializedDevice.lastDeploymentId = lastDeploymentId; + deserializedDevice.lastInstallResult = lastInstallResult; + + return deserializedDevice; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClass.java new file mode 100644 index 000000000000..4ee2cfda9d68 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClass.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Device class metadata. + */ +@Immutable +public final class DeviceClass implements JsonSerializable { + /* + * 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. + */ + @Generated + private final String deviceClassId; + + /* + * The device class friendly name. This can be updated by callers after the device + * class has been automatically created. + */ + @Generated + private String friendlyName; + + /* + * The device class properties that are used to calculate the device class Id + */ + @Generated + private final DeviceClassProperties deviceClassProperties; + + /* + * Update that is the highest version compatible with this device class. + */ + @Generated + private UpdateInfo bestCompatibleUpdate; + + /** + * Creates an instance of DeviceClass class. + * + * @param deviceClassId the deviceClassId value to set. + * @param deviceClassProperties the deviceClassProperties value to set. + */ + @Generated + private DeviceClass(String deviceClassId, DeviceClassProperties deviceClassProperties) { + this.deviceClassId = deviceClassId; + this.deviceClassProperties = deviceClassProperties; + } + + /** + * Get the deviceClassId property: 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. + * + * @return the deviceClassId value. + */ + @Generated + public String getDeviceClassId() { + return this.deviceClassId; + } + + /** + * Get the friendlyName property: The device class friendly name. This can be updated by callers after the device + * class has been automatically created. + * + * @return the friendlyName value. + */ + @Generated + public String getFriendlyName() { + return this.friendlyName; + } + + /** + * Get the deviceClassProperties property: The device class properties that are used to calculate the device class + * Id. + * + * @return the deviceClassProperties value. + */ + @Generated + public DeviceClassProperties getDeviceClassProperties() { + return this.deviceClassProperties; + } + + /** + * Get the bestCompatibleUpdate property: Update that is the highest version compatible with this device class. + * + * @return the bestCompatibleUpdate value. + */ + @Generated + public UpdateInfo getBestCompatibleUpdate() { + return this.bestCompatibleUpdate; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceClassId", this.deviceClassId); + jsonWriter.writeJsonField("deviceClassProperties", this.deviceClassProperties); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeJsonField("bestCompatibleUpdate", this.bestCompatibleUpdate); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceClass from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceClass if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceClass. + */ + @Generated + public static DeviceClass fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deviceClassId = null; + DeviceClassProperties deviceClassProperties = null; + String friendlyName = null; + UpdateInfo bestCompatibleUpdate = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceClassId".equals(fieldName)) { + deviceClassId = reader.getString(); + } else if ("deviceClassProperties".equals(fieldName)) { + deviceClassProperties = DeviceClassProperties.fromJson(reader); + } else if ("friendlyName".equals(fieldName)) { + friendlyName = reader.getString(); + } else if ("bestCompatibleUpdate".equals(fieldName)) { + bestCompatibleUpdate = UpdateInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + DeviceClass deserializedDeviceClass = new DeviceClass(deviceClassId, deviceClassProperties); + deserializedDeviceClass.friendlyName = friendlyName; + deserializedDeviceClass.bestCompatibleUpdate = bestCompatibleUpdate; + + return deserializedDeviceClass; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassProperties.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassProperties.java new file mode 100644 index 000000000000..24d4662d1997 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassProperties.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The device class properties that are used to calculate the device class Id. + */ +@Immutable +public final class DeviceClassProperties implements JsonSerializable { + /* + * The Device Update agent contract model. + */ + @Generated + private ContractModel contractModel; + + /* + * 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 + */ + @Generated + private final Map compatProperties; + + /** + * Creates an instance of DeviceClassProperties class. + * + * @param compatProperties the compatProperties value to set. + */ + @Generated + private DeviceClassProperties(Map compatProperties) { + this.compatProperties = compatProperties; + } + + /** + * Get the contractModel property: The Device Update agent contract model. + * + * @return the contractModel value. + */ + @Generated + public ContractModel getContractModel() { + return this.contractModel; + } + + /** + * Get the compatProperties property: 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. + * + * @return the compatProperties value. + */ + @Generated + public Map getCompatProperties() { + return this.compatProperties; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("compatProperties", this.compatProperties, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("contractModel", this.contractModel); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceClassProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceClassProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceClassProperties. + */ + @Generated + public static DeviceClassProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Map compatProperties = null; + ContractModel contractModel = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("compatProperties".equals(fieldName)) { + compatProperties = reader.readMap(reader1 -> reader1.getString()); + } else if ("contractModel".equals(fieldName)) { + contractModel = ContractModel.fromJson(reader); + } else { + reader.skipChildren(); + } + } + DeviceClassProperties deserializedDeviceClassProperties = new DeviceClassProperties(compatProperties); + deserializedDeviceClassProperties.contractModel = contractModel; + + return deserializedDeviceClassProperties; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroup.java new file mode 100644 index 000000000000..d5f84958ee7f --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroup.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Device class subgroup details. A device class subgroup is a subset of devices + * in a group that share the same device class id. + */ +@Immutable +public final class DeviceClassSubgroup implements JsonSerializable { + /* + * 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. + */ + @Generated + private final String deviceClassId; + + /* + * Group identity. + */ + @Generated + private final String groupId; + + /* + * Date and time when the device class subgroup was created. + */ + @Generated + private final String createdDateTime; + + /* + * The number of devices in the device class subgroup. + */ + @Generated + private Integer deviceCount; + + /* + * The active deployment Id for the device class subgroup. + */ + @Generated + private String deploymentId; + + /** + * Creates an instance of DeviceClassSubgroup class. + * + * @param deviceClassId the deviceClassId value to set. + * @param groupId the groupId value to set. + * @param createdDateTime the createdDateTime value to set. + */ + @Generated + private DeviceClassSubgroup(String deviceClassId, String groupId, String createdDateTime) { + this.deviceClassId = deviceClassId; + this.groupId = groupId; + this.createdDateTime = createdDateTime; + } + + /** + * Get the deviceClassId property: 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. + * + * @return the deviceClassId value. + */ + @Generated + public String getDeviceClassId() { + return this.deviceClassId; + } + + /** + * Get the groupId property: Group identity. + * + * @return the groupId value. + */ + @Generated + public String getGroupId() { + return this.groupId; + } + + /** + * Get the createdDateTime property: Date and time when the device class subgroup was created. + * + * @return the createdDateTime value. + */ + @Generated + public String getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the deviceCount property: The number of devices in the device class subgroup. + * + * @return the deviceCount value. + */ + @Generated + public Integer getDeviceCount() { + return this.deviceCount; + } + + /** + * Get the deploymentId property: The active deployment Id for the device class subgroup. + * + * @return the deploymentId value. + */ + @Generated + public String getDeploymentId() { + return this.deploymentId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceClassId", this.deviceClassId); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("createdDateTime", this.createdDateTime); + jsonWriter.writeNumberField("deviceCount", this.deviceCount); + jsonWriter.writeStringField("deploymentId", this.deploymentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceClassSubgroup from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceClassSubgroup if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceClassSubgroup. + */ + @Generated + public static DeviceClassSubgroup fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deviceClassId = null; + String groupId = null; + String createdDateTime = null; + Integer deviceCount = null; + String deploymentId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceClassId".equals(fieldName)) { + deviceClassId = reader.getString(); + } else if ("groupId".equals(fieldName)) { + groupId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader.getString(); + } else if ("deviceCount".equals(fieldName)) { + deviceCount = reader.getNullable(JsonReader::getInt); + } else if ("deploymentId".equals(fieldName)) { + deploymentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + DeviceClassSubgroup deserializedDeviceClassSubgroup + = new DeviceClassSubgroup(deviceClassId, groupId, createdDateTime); + deserializedDeviceClassSubgroup.deviceCount = deviceCount; + deserializedDeviceClassSubgroup.deploymentId = deploymentId; + + return deserializedDeviceClassSubgroup; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentState.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentState.java new file mode 100644 index 000000000000..fd4f491a45ee --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentState.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Device class subgroup deployment state. + */ +public final class DeviceClassSubgroupDeploymentState extends ExpandableStringEnum { + /** + * The subgroup deployment can be sent to devices targeted in the deployment. + */ + @Generated + public static final DeviceClassSubgroupDeploymentState ACTIVE = fromString("Active"); + + /** + * The subgroup deployment failed and will not be sent to any devices. + */ + @Generated + public static final DeviceClassSubgroupDeploymentState FAILED = fromString("Failed"); + + /** + * A newer deployment for this subgroup has been created and no devices in the + * subgroup will receive this deployment. + */ + @Generated + public static final DeviceClassSubgroupDeploymentState INACTIVE = fromString("Inactive"); + + /** + * The subgroup deployment has been canceled and no devices will receive it. + */ + @Generated + public static final DeviceClassSubgroupDeploymentState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of DeviceClassSubgroupDeploymentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DeviceClassSubgroupDeploymentState() { + } + + /** + * Creates or finds a DeviceClassSubgroupDeploymentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceClassSubgroupDeploymentState. + */ + @Generated + public static DeviceClassSubgroupDeploymentState fromString(String name) { + return fromString(name, DeviceClassSubgroupDeploymentState.class); + } + + /** + * Gets known DeviceClassSubgroupDeploymentState values. + * + * @return known DeviceClassSubgroupDeploymentState values. + */ + @Generated + public static Collection values() { + return values(DeviceClassSubgroupDeploymentState.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentStatus.java new file mode 100644 index 000000000000..d99c48d2bd22 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentStatus.java @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Device class subgroup deployment status metadata. + */ +@Immutable +public final class DeviceClassSubgroupDeploymentStatus + implements JsonSerializable { + /* + * The group identity + */ + @Generated + private final String groupId; + + /* + * The device class subgroup identity + */ + @Generated + private final String deviceClassId; + + /* + * The state of the subgroup deployment. + */ + @Generated + private final DeviceClassSubgroupDeploymentState deploymentState; + + /* + * The error details of the Failed state. This is not present if the deployment + * state is not Failed. + */ + @Generated + private Error error; + + /* + * The total number of devices in the deployment. + */ + @Generated + private Integer totalDevices; + + /* + * The number of devices that are currently in deployment. + */ + @Generated + private Integer devicesInProgressCount; + + /* + * The number of devices that have completed deployment with a failure. + */ + @Generated + private Integer devicesCompletedFailedCount; + + /* + * The number of devices which have successfully completed deployment. + */ + @Generated + private Integer devicesCompletedSucceededCount; + + /* + * The number of devices which have had their deployment canceled. + */ + @Generated + private Integer devicesCanceledCount; + + /** + * Creates an instance of DeviceClassSubgroupDeploymentStatus class. + * + * @param groupId the groupId value to set. + * @param deviceClassId the deviceClassId value to set. + * @param deploymentState the deploymentState value to set. + */ + @Generated + private DeviceClassSubgroupDeploymentStatus(String groupId, String deviceClassId, + DeviceClassSubgroupDeploymentState deploymentState) { + this.groupId = groupId; + this.deviceClassId = deviceClassId; + this.deploymentState = deploymentState; + } + + /** + * Get the groupId property: The group identity. + * + * @return the groupId value. + */ + @Generated + public String getGroupId() { + return this.groupId; + } + + /** + * Get the deviceClassId property: The device class subgroup identity. + * + * @return the deviceClassId value. + */ + @Generated + public String getDeviceClassId() { + return this.deviceClassId; + } + + /** + * Get the deploymentState property: The state of the subgroup deployment. + * + * @return the deploymentState value. + */ + @Generated + public DeviceClassSubgroupDeploymentState getDeploymentState() { + return this.deploymentState; + } + + /** + * Get the error property: The error details of the Failed state. This is not present if the deployment + * state is not Failed. + * + * @return the error value. + */ + @Generated + public Error getError() { + return this.error; + } + + /** + * Get the totalDevices property: The total number of devices in the deployment. + * + * @return the totalDevices value. + */ + @Generated + public Integer getTotalDevices() { + return this.totalDevices; + } + + /** + * Get the devicesInProgressCount property: The number of devices that are currently in deployment. + * + * @return the devicesInProgressCount value. + */ + @Generated + public Integer getDevicesInProgressCount() { + return this.devicesInProgressCount; + } + + /** + * Get the devicesCompletedFailedCount property: The number of devices that have completed deployment with a + * failure. + * + * @return the devicesCompletedFailedCount value. + */ + @Generated + public Integer getDevicesCompletedFailedCount() { + return this.devicesCompletedFailedCount; + } + + /** + * Get the devicesCompletedSucceededCount property: The number of devices which have successfully completed + * deployment. + * + * @return the devicesCompletedSucceededCount value. + */ + @Generated + public Integer getDevicesCompletedSucceededCount() { + return this.devicesCompletedSucceededCount; + } + + /** + * Get the devicesCanceledCount property: The number of devices which have had their deployment canceled. + * + * @return the devicesCanceledCount value. + */ + @Generated + public Integer getDevicesCanceledCount() { + return this.devicesCanceledCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("deviceClassId", this.deviceClassId); + jsonWriter.writeStringField("deploymentState", + this.deploymentState == null ? null : this.deploymentState.toString()); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeNumberField("totalDevices", this.totalDevices); + jsonWriter.writeNumberField("devicesInProgressCount", this.devicesInProgressCount); + jsonWriter.writeNumberField("devicesCompletedFailedCount", this.devicesCompletedFailedCount); + jsonWriter.writeNumberField("devicesCompletedSucceededCount", this.devicesCompletedSucceededCount); + jsonWriter.writeNumberField("devicesCanceledCount", this.devicesCanceledCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceClassSubgroupDeploymentStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceClassSubgroupDeploymentStatus if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceClassSubgroupDeploymentStatus. + */ + @Generated + public static DeviceClassSubgroupDeploymentStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String groupId = null; + String deviceClassId = null; + DeviceClassSubgroupDeploymentState deploymentState = null; + Error error = null; + Integer totalDevices = null; + Integer devicesInProgressCount = null; + Integer devicesCompletedFailedCount = null; + Integer devicesCompletedSucceededCount = null; + Integer devicesCanceledCount = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + groupId = reader.getString(); + } else if ("deviceClassId".equals(fieldName)) { + deviceClassId = reader.getString(); + } else if ("deploymentState".equals(fieldName)) { + deploymentState = DeviceClassSubgroupDeploymentState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + error = Error.fromJson(reader); + } else if ("totalDevices".equals(fieldName)) { + totalDevices = reader.getNullable(JsonReader::getInt); + } else if ("devicesInProgressCount".equals(fieldName)) { + devicesInProgressCount = reader.getNullable(JsonReader::getInt); + } else if ("devicesCompletedFailedCount".equals(fieldName)) { + devicesCompletedFailedCount = reader.getNullable(JsonReader::getInt); + } else if ("devicesCompletedSucceededCount".equals(fieldName)) { + devicesCompletedSucceededCount = reader.getNullable(JsonReader::getInt); + } else if ("devicesCanceledCount".equals(fieldName)) { + devicesCanceledCount = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + DeviceClassSubgroupDeploymentStatus deserializedDeviceClassSubgroupDeploymentStatus + = new DeviceClassSubgroupDeploymentStatus(groupId, deviceClassId, deploymentState); + deserializedDeviceClassSubgroupDeploymentStatus.error = error; + deserializedDeviceClassSubgroupDeploymentStatus.totalDevices = totalDevices; + deserializedDeviceClassSubgroupDeploymentStatus.devicesInProgressCount = devicesInProgressCount; + deserializedDeviceClassSubgroupDeploymentStatus.devicesCompletedFailedCount = devicesCompletedFailedCount; + deserializedDeviceClassSubgroupDeploymentStatus.devicesCompletedSucceededCount + = devicesCompletedSucceededCount; + deserializedDeviceClassSubgroupDeploymentStatus.devicesCanceledCount = devicesCanceledCount; + + return deserializedDeviceClassSubgroupDeploymentStatus; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupUpdatableDevices.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupUpdatableDevices.java new file mode 100644 index 000000000000..489d21493d89 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupUpdatableDevices.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Device class subgroup, update information, and the number of devices for which + * the update is applicable. + */ +@Immutable +public final class DeviceClassSubgroupUpdatableDevices + implements JsonSerializable { + /* + * The group Id + */ + @Generated + private final String groupId; + + /* + * The device class subgroup's device class Id + */ + @Generated + private final String deviceClassId; + + /* + * Update information. + */ + @Generated + private final UpdateInfo update; + + /* + * Total number of devices for which the update is applicable. + */ + @Generated + private final int deviceCount; + + /** + * Creates an instance of DeviceClassSubgroupUpdatableDevices class. + * + * @param groupId the groupId value to set. + * @param deviceClassId the deviceClassId value to set. + * @param update the update value to set. + * @param deviceCount the deviceCount value to set. + */ + @Generated + private DeviceClassSubgroupUpdatableDevices(String groupId, String deviceClassId, UpdateInfo update, + int deviceCount) { + this.groupId = groupId; + this.deviceClassId = deviceClassId; + this.update = update; + this.deviceCount = deviceCount; + } + + /** + * Get the groupId property: The group Id. + * + * @return the groupId value. + */ + @Generated + public String getGroupId() { + return this.groupId; + } + + /** + * Get the deviceClassId property: The device class subgroup's device class Id. + * + * @return the deviceClassId value. + */ + @Generated + public String getDeviceClassId() { + return this.deviceClassId; + } + + /** + * Get the update property: Update information. + * + * @return the update value. + */ + @Generated + public UpdateInfo getUpdate() { + return this.update; + } + + /** + * Get the deviceCount property: Total number of devices for which the update is applicable. + * + * @return the deviceCount value. + */ + @Generated + public int getDeviceCount() { + return this.deviceCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("deviceClassId", this.deviceClassId); + jsonWriter.writeJsonField("update", this.update); + jsonWriter.writeIntField("deviceCount", this.deviceCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceClassSubgroupUpdatableDevices from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceClassSubgroupUpdatableDevices if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceClassSubgroupUpdatableDevices. + */ + @Generated + public static DeviceClassSubgroupUpdatableDevices fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String groupId = null; + String deviceClassId = null; + UpdateInfo update = null; + int deviceCount = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + groupId = reader.getString(); + } else if ("deviceClassId".equals(fieldName)) { + deviceClassId = reader.getString(); + } else if ("update".equals(fieldName)) { + update = UpdateInfo.fromJson(reader); + } else if ("deviceCount".equals(fieldName)) { + deviceCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new DeviceClassSubgroupUpdatableDevices(groupId, deviceClassId, update, deviceCount); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceDeploymentState.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceDeploymentState.java new file mode 100644 index 000000000000..7001b398940a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceDeploymentState.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Deployment state. + */ +public final class DeviceDeploymentState extends ExpandableStringEnum { + /** + * Deployment has completed with success. + */ + @Generated + public static final DeviceDeploymentState SUCCEEDED = fromString("Succeeded"); + + /** + * Deployment is in progress. + */ + @Generated + public static final DeviceDeploymentState IN_PROGRESS = fromString("InProgress"); + + /** + * Deployment was canceled. + */ + @Generated + public static final DeviceDeploymentState CANCELED = fromString("Canceled"); + + /** + * Deployment has completed with failure. + */ + @Generated + public static final DeviceDeploymentState FAILED = fromString("Failed"); + + /** + * Creates a new instance of DeviceDeploymentState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DeviceDeploymentState() { + } + + /** + * Creates or finds a DeviceDeploymentState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceDeploymentState. + */ + @Generated + public static DeviceDeploymentState fromString(String name) { + return fromString(name, DeviceDeploymentState.class); + } + + /** + * Gets known DeviceDeploymentState values. + * + * @return known DeviceDeploymentState values. + */ + @Generated + public static Collection values() { + return values(DeviceDeploymentState.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceHealth.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceHealth.java new file mode 100644 index 000000000000..a4d7b9df9727 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceHealth.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Device Health. + */ +@Immutable +public final class DeviceHealth implements JsonSerializable { + /* + * Device id + */ + @Generated + private final String deviceId; + + /* + * Module id + */ + @Generated + private String moduleId; + + /* + * Aggregate device health state + */ + @Generated + private final DeviceHealthState state; + + /* + * Digital twin model Id + */ + @Generated + private String digitalTwinModelId; + + /* + * Array of health checks and their results + */ + @Generated + private final List healthChecks; + + /** + * Creates an instance of DeviceHealth class. + * + * @param deviceId the deviceId value to set. + * @param state the state value to set. + * @param healthChecks the healthChecks value to set. + */ + @Generated + private DeviceHealth(String deviceId, DeviceHealthState state, List healthChecks) { + this.deviceId = deviceId; + this.state = state; + this.healthChecks = healthChecks; + } + + /** + * Get the deviceId property: Device id. + * + * @return the deviceId value. + */ + @Generated + public String getDeviceId() { + return this.deviceId; + } + + /** + * Get the moduleId property: Module id. + * + * @return the moduleId value. + */ + @Generated + public String getModuleId() { + return this.moduleId; + } + + /** + * Get the state property: Aggregate device health state. + * + * @return the state value. + */ + @Generated + public DeviceHealthState getState() { + return this.state; + } + + /** + * Get the digitalTwinModelId property: Digital twin model Id. + * + * @return the digitalTwinModelId value. + */ + @Generated + public String getDigitalTwinModelId() { + return this.digitalTwinModelId; + } + + /** + * Get the healthChecks property: Array of health checks and their results. + * + * @return the healthChecks value. + */ + @Generated + public List getHealthChecks() { + return this.healthChecks; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceId", this.deviceId); + jsonWriter.writeStringField("state", this.state == null ? null : this.state.toString()); + jsonWriter.writeArrayField("healthChecks", this.healthChecks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("moduleId", this.moduleId); + jsonWriter.writeStringField("digitalTwinModelId", this.digitalTwinModelId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceHealth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceHealth if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceHealth. + */ + @Generated + public static DeviceHealth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deviceId = null; + DeviceHealthState state = null; + List healthChecks = null; + String moduleId = null; + String digitalTwinModelId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceId".equals(fieldName)) { + deviceId = reader.getString(); + } else if ("state".equals(fieldName)) { + state = DeviceHealthState.fromString(reader.getString()); + } else if ("healthChecks".equals(fieldName)) { + healthChecks = reader.readArray(reader1 -> HealthCheck.fromJson(reader1)); + } else if ("moduleId".equals(fieldName)) { + moduleId = reader.getString(); + } else if ("digitalTwinModelId".equals(fieldName)) { + digitalTwinModelId = reader.getString(); + } else { + reader.skipChildren(); + } + } + DeviceHealth deserializedDeviceHealth = new DeviceHealth(deviceId, state, healthChecks); + deserializedDeviceHealth.moduleId = moduleId; + deserializedDeviceHealth.digitalTwinModelId = digitalTwinModelId; + + return deserializedDeviceHealth; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceHealthState.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceHealthState.java new file mode 100644 index 000000000000..27fda27f959d --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceHealthState.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Device health states. + */ +public final class DeviceHealthState extends ExpandableStringEnum { + /** + * Agent is healthy. + */ + @Generated + public static final DeviceHealthState HEALTHY = fromString("healthy"); + + /** + * Agent is in an unhealthy state. + */ + @Generated + public static final DeviceHealthState UNHEALTHY = fromString("unhealthy"); + + /** + * Creates a new instance of DeviceHealthState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DeviceHealthState() { + } + + /** + * Creates or finds a DeviceHealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding DeviceHealthState. + */ + @Generated + public static DeviceHealthState fromString(String name) { + return fromString(name, DeviceHealthState.class); + } + + /** + * Gets known DeviceHealthState values. + * + * @return known DeviceHealthState values. + */ + @Generated + public static Collection values() { + return values(DeviceHealthState.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceOperation.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceOperation.java new file mode 100644 index 000000000000..474c63a6bcea --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceOperation.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Operation metadata. + */ +@Immutable +public final class DeviceOperation implements JsonSerializable { + /* + * Operation Id. + */ + @Generated + private final String operationId; + + /* + * Operation status. + */ + @Generated + private final OperationStatus status; + + /* + * Operation error encountered, if any. + */ + @Generated + private Error error; + + /* + * Operation correlation identity that can used by Microsoft Support for + * troubleshooting. + */ + @Generated + private String traceId; + + /* + * Date and time in UTC when the operation status was last updated. + */ + @Generated + private final OffsetDateTime lastActionDateTime; + + /* + * Date and time in UTC when the operation was created. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * Operation ETag. + */ + @Generated + private String etag; + + /** + * Creates an instance of DeviceOperation class. + * + * @param operationId the operationId value to set. + * @param status the status value to set. + * @param lastActionDateTime the lastActionDateTime value to set. + * @param createdDateTime the createdDateTime value to set. + */ + @Generated + private DeviceOperation(String operationId, OperationStatus status, OffsetDateTime lastActionDateTime, + OffsetDateTime createdDateTime) { + this.operationId = operationId; + this.status = status; + this.lastActionDateTime = lastActionDateTime; + this.createdDateTime = createdDateTime; + } + + /** + * Get the operationId property: Operation Id. + * + * @return the operationId value. + */ + @Generated + public String getOperationId() { + return this.operationId; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + @Generated + public OperationStatus getStatus() { + return this.status; + } + + /** + * Get the error property: Operation error encountered, if any. + * + * @return the error value. + */ + @Generated + public Error getError() { + return this.error; + } + + /** + * Get the traceId property: Operation correlation identity that can used by Microsoft Support for + * troubleshooting. + * + * @return the traceId value. + */ + @Generated + public String getTraceId() { + return this.traceId; + } + + /** + * Get the lastActionDateTime property: Date and time in UTC when the operation status was last updated. + * + * @return the lastActionDateTime value. + */ + @Generated + public OffsetDateTime getLastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the createdDateTime property: Date and time in UTC when the operation was created. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the etag property: Operation ETag. + * + * @return the etag value. + */ + @Generated + public String getEtag() { + return this.etag; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("lastActionDateTime", + this.lastActionDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActionDateTime)); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeStringField("traceId", this.traceId); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceOperation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceOperation. + */ + @Generated + public static DeviceOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String operationId = null; + OperationStatus status = null; + OffsetDateTime lastActionDateTime = null; + OffsetDateTime createdDateTime = null; + Error error = null; + String traceId = null; + String etag = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationStatus.fromString(reader.getString()); + } else if ("lastActionDateTime".equals(fieldName)) { + lastActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("error".equals(fieldName)) { + error = Error.fromJson(reader); + } else if ("traceId".equals(fieldName)) { + traceId = reader.getString(); + } else if ("etag".equals(fieldName)) { + etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + DeviceOperation deserializedDeviceOperation + = new DeviceOperation(operationId, status, lastActionDateTime, createdDateTime); + deserializedDeviceOperation.error = error; + deserializedDeviceOperation.traceId = traceId; + deserializedDeviceOperation.etag = etag; + + return deserializedDeviceOperation; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceUpdateAgentId.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceUpdateAgentId.java new file mode 100644 index 000000000000..2c667cb1d2ce --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DeviceUpdateAgentId.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Device Update agent id. + */ +@Fluent +public final class DeviceUpdateAgentId implements JsonSerializable { + /* + * Device Id + */ + @Generated + private final String deviceId; + + /* + * Module Id + */ + @Generated + private String moduleId; + + /** + * Creates an instance of DeviceUpdateAgentId class. + * + * @param deviceId the deviceId value to set. + */ + @Generated + public DeviceUpdateAgentId(String deviceId) { + this.deviceId = deviceId; + } + + /** + * Get the deviceId property: Device Id. + * + * @return the deviceId value. + */ + @Generated + public String getDeviceId() { + return this.deviceId; + } + + /** + * Get the moduleId property: Module Id. + * + * @return the moduleId value. + */ + @Generated + public String getModuleId() { + return this.moduleId; + } + + /** + * Set the moduleId property: Module Id. + * + * @param moduleId the moduleId value to set. + * @return the DeviceUpdateAgentId object itself. + */ + @Generated + public DeviceUpdateAgentId setModuleId(String moduleId) { + this.moduleId = moduleId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceId", this.deviceId); + jsonWriter.writeStringField("moduleId", this.moduleId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DeviceUpdateAgentId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DeviceUpdateAgentId if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DeviceUpdateAgentId. + */ + @Generated + public static DeviceUpdateAgentId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deviceId = null; + String moduleId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceId".equals(fieldName)) { + deviceId = reader.getString(); + } else if ("moduleId".equals(fieldName)) { + moduleId = reader.getString(); + } else { + reader.skipChildren(); + } + } + DeviceUpdateAgentId deserializedDeviceUpdateAgentId = new DeviceUpdateAgentId(deviceId); + deserializedDeviceUpdateAgentId.moduleId = moduleId; + + return deserializedDeviceUpdateAgentId; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DownloadSecurity.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DownloadSecurity.java new file mode 100644 index 000000000000..582ada6c3958 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/DownloadSecurity.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The protocol the device should use when downloading the update payload. + */ +public final class DownloadSecurity extends ExpandableStringEnum { + /** + * Download update payload over HTTPS. + */ + @Generated + public static final DownloadSecurity HTTPS = fromString("https"); + + /** + * Download update payload over HTTP. + */ + @Generated + public static final DownloadSecurity HTTP = fromString("http"); + + /** + * Creates a new instance of DownloadSecurity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DownloadSecurity() { + } + + /** + * Creates or finds a DownloadSecurity from its string representation. + * + * @param name a name to look for. + * @return the corresponding DownloadSecurity. + */ + @Generated + public static DownloadSecurity fromString(String name) { + return fromString(name, DownloadSecurity.class); + } + + /** + * Gets known DownloadSecurity values. + * + * @return known DownloadSecurity values. + */ + @Generated + public static Collection values() { + return values(DownloadSecurity.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Error.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Error.java new file mode 100644 index 000000000000..df6b9d508818 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Error.java @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Error details. + */ +@Immutable +public final class Error implements JsonSerializable { + /* + * Server defined error code. + */ + @Generated + private final String code; + + /* + * A human-readable representation of the error. + */ + @Generated + private final String message; + + /* + * The target of the error. + */ + @Generated + private String target; + + /* + * An array of errors that led to the reported error. + */ + @Generated + private List details; + + /* + * An object containing more specific information than the current object about + * the error. + */ + @Generated + private InnerError innererror; + + /* + * Date and time in UTC when the error occurred. + */ + @Generated + private OffsetDateTime occurredDateTime; + + /** + * Creates an instance of Error class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private Error(String code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: Server defined error code. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: A human-readable representation of the error. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the target property: The target of the error. + * + * @return the target value. + */ + @Generated + public String getTarget() { + return this.target; + } + + /** + * Get the details property: An array of errors that led to the reported error. + * + * @return the details value. + */ + @Generated + public List getDetails() { + return this.details; + } + + /** + * Get the innererror property: An object containing more specific information than the current object about + * the error. + * + * @return the innererror value. + */ + @Generated + public InnerError getInnererror() { + return this.innererror; + } + + /** + * Get the occurredDateTime property: Date and time in UTC when the error occurred. + * + * @return the occurredDateTime value. + */ + @Generated + public OffsetDateTime getOccurredDateTime() { + return this.occurredDateTime; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("target", this.target); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("innererror", this.innererror); + jsonWriter.writeStringField("occurredDateTime", + this.occurredDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.occurredDateTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Error from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Error. + */ + @Generated + public static Error fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + String target = null; + List details = null; + InnerError innererror = null; + OffsetDateTime occurredDateTime = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("target".equals(fieldName)) { + target = reader.getString(); + } else if ("details".equals(fieldName)) { + details = reader.readArray(reader1 -> Error.fromJson(reader1)); + } else if ("innererror".equals(fieldName)) { + innererror = InnerError.fromJson(reader); + } else if ("occurredDateTime".equals(fieldName)) { + occurredDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + Error deserializedError = new Error(code, message); + deserializedError.target = target; + deserializedError.details = details; + deserializedError.innererror = innererror; + deserializedError.occurredDateTime = occurredDateTime; + + return deserializedError; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/FileImportMetadata.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/FileImportMetadata.java new file mode 100644 index 000000000000..31dac1042691 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/FileImportMetadata.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Metadata describing an update file. + */ +@Immutable +public final class FileImportMetadata implements JsonSerializable { + /* + * Update file name as specified inside import manifest. + */ + @Generated + private final String filename; + + /* + * 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. + */ + @Generated + private final String url; + + /** + * Creates an instance of FileImportMetadata class. + * + * @param filename the filename value to set. + * @param url the url value to set. + */ + @Generated + public FileImportMetadata(String filename, String url) { + this.filename = filename; + this.url = url; + } + + /** + * Get the filename property: Update file name as specified inside import manifest. + * + * @return the filename value. + */ + @Generated + public String getFilename() { + return this.filename; + } + + /** + * Get the url property: 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. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("filename", this.filename); + jsonWriter.writeStringField("url", this.url); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileImportMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileImportMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileImportMetadata. + */ + @Generated + public static FileImportMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String filename = null; + String url = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filename".equals(fieldName)) { + filename = reader.getString(); + } else if ("url".equals(fieldName)) { + url = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new FileImportMetadata(filename, url); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Group.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Group.java new file mode 100644 index 000000000000..6d5149faafde --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Group.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Group details. + */ +@Immutable +public final class Group implements JsonSerializable { + /* + * 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. + */ + @Generated + private final String groupId; + + /* + * Group type. + */ + @Generated + private final GroupType groupType; + + /* + * Date and time when the update was created. + */ + @Generated + private final String createdDateTime; + + /* + * The number of devices in the group. + */ + @Generated + private Integer deviceCount; + + /* + * The count of subgroups with new updates available. + */ + @Generated + private Integer subgroupsWithNewUpdatesAvailableCount; + + /* + * The count of subgroups with updates in progress. + */ + @Generated + private Integer subgroupsWithUpdatesInProgressCount; + + /* + * The count of subgroups with devices on the latest update. + */ + @Generated + private Integer subgroupsWithOnLatestUpdateCount; + + /* + * The active deployment Ids for the group + */ + @Generated + private List deployments; + + /** + * Creates an instance of Group class. + * + * @param groupId the groupId value to set. + * @param groupType the groupType value to set. + * @param createdDateTime the createdDateTime value to set. + */ + @Generated + private Group(String groupId, GroupType groupType, String createdDateTime) { + this.groupId = groupId; + this.groupType = groupType; + this.createdDateTime = createdDateTime; + } + + /** + * Get the groupId property: 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. + * + * @return the groupId value. + */ + @Generated + public String getGroupId() { + return this.groupId; + } + + /** + * Get the groupType property: Group type. + * + * @return the groupType value. + */ + @Generated + public GroupType getGroupType() { + return this.groupType; + } + + /** + * Get the createdDateTime property: Date and time when the update was created. + * + * @return the createdDateTime value. + */ + @Generated + public String getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the deviceCount property: The number of devices in the group. + * + * @return the deviceCount value. + */ + @Generated + public Integer getDeviceCount() { + return this.deviceCount; + } + + /** + * Get the subgroupsWithNewUpdatesAvailableCount property: The count of subgroups with new updates available. + * + * @return the subgroupsWithNewUpdatesAvailableCount value. + */ + @Generated + public Integer getSubgroupsWithNewUpdatesAvailableCount() { + return this.subgroupsWithNewUpdatesAvailableCount; + } + + /** + * Get the subgroupsWithUpdatesInProgressCount property: The count of subgroups with updates in progress. + * + * @return the subgroupsWithUpdatesInProgressCount value. + */ + @Generated + public Integer getSubgroupsWithUpdatesInProgressCount() { + return this.subgroupsWithUpdatesInProgressCount; + } + + /** + * Get the subgroupsWithOnLatestUpdateCount property: The count of subgroups with devices on the latest update. + * + * @return the subgroupsWithOnLatestUpdateCount value. + */ + @Generated + public Integer getSubgroupsWithOnLatestUpdateCount() { + return this.subgroupsWithOnLatestUpdateCount; + } + + /** + * Get the deployments property: The active deployment Ids for the group. + * + * @return the deployments value. + */ + @Generated + public List getDeployments() { + return this.deployments; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeStringField("groupType", this.groupType == null ? null : this.groupType.toString()); + jsonWriter.writeStringField("createdDateTime", this.createdDateTime); + jsonWriter.writeNumberField("deviceCount", this.deviceCount); + jsonWriter.writeNumberField("subgroupsWithNewUpdatesAvailableCount", + this.subgroupsWithNewUpdatesAvailableCount); + jsonWriter.writeNumberField("subgroupsWithUpdatesInProgressCount", this.subgroupsWithUpdatesInProgressCount); + jsonWriter.writeNumberField("subgroupsWithOnLatestUpdateCount", this.subgroupsWithOnLatestUpdateCount); + jsonWriter.writeArrayField("deployments", this.deployments, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Group from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Group if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Group. + */ + @Generated + public static Group fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String groupId = null; + GroupType groupType = null; + String createdDateTime = null; + Integer deviceCount = null; + Integer subgroupsWithNewUpdatesAvailableCount = null; + Integer subgroupsWithUpdatesInProgressCount = null; + Integer subgroupsWithOnLatestUpdateCount = null; + List deployments = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + groupId = reader.getString(); + } else if ("groupType".equals(fieldName)) { + groupType = GroupType.fromString(reader.getString()); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader.getString(); + } else if ("deviceCount".equals(fieldName)) { + deviceCount = reader.getNullable(JsonReader::getInt); + } else if ("subgroupsWithNewUpdatesAvailableCount".equals(fieldName)) { + subgroupsWithNewUpdatesAvailableCount = reader.getNullable(JsonReader::getInt); + } else if ("subgroupsWithUpdatesInProgressCount".equals(fieldName)) { + subgroupsWithUpdatesInProgressCount = reader.getNullable(JsonReader::getInt); + } else if ("subgroupsWithOnLatestUpdateCount".equals(fieldName)) { + subgroupsWithOnLatestUpdateCount = reader.getNullable(JsonReader::getInt); + } else if ("deployments".equals(fieldName)) { + deployments = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + Group deserializedGroup = new Group(groupId, groupType, createdDateTime); + deserializedGroup.deviceCount = deviceCount; + deserializedGroup.subgroupsWithNewUpdatesAvailableCount = subgroupsWithNewUpdatesAvailableCount; + deserializedGroup.subgroupsWithUpdatesInProgressCount = subgroupsWithUpdatesInProgressCount; + deserializedGroup.subgroupsWithOnLatestUpdateCount = subgroupsWithOnLatestUpdateCount; + deserializedGroup.deployments = deployments; + + return deserializedGroup; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/GroupType.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/GroupType.java new file mode 100644 index 000000000000..96bf3816cca2 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/GroupType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported group types. + */ +public final class GroupType extends ExpandableStringEnum { + /** + * IoT Hub tag based group, all devices in the group share an ADUGroup tag value. + */ + @Generated + public static final GroupType IO_THUB_TAG = fromString("IoTHubTag"); + + /** + * Default group for untagged devices. + */ + @Generated + public static final GroupType DEFAULT_NO_TAG = fromString("DefaultNoTag"); + + /** + * Creates a new instance of GroupType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GroupType() { + } + + /** + * Creates or finds a GroupType from its string representation. + * + * @param name a name to look for. + * @return the corresponding GroupType. + */ + @Generated + public static GroupType fromString(String name) { + return fromString(name, GroupType.class); + } + + /** + * Gets known GroupType values. + * + * @return known GroupType values. + */ + @Generated + public static Collection values() { + return values(GroupType.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/HealthCheck.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/HealthCheck.java new file mode 100644 index 000000000000..559c84e5c52d --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/HealthCheck.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Health check. + */ +@Immutable +public final class HealthCheck implements JsonSerializable { + /* + * Health check name + */ + @Generated + private String name; + + /* + * Health check result + */ + @Generated + private HealthCheckResult result; + + /** + * Creates an instance of HealthCheck class. + */ + @Generated + private HealthCheck() { + } + + /** + * Get the name property: Health check name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the result property: Health check result. + * + * @return the result value. + */ + @Generated + public HealthCheckResult getResult() { + return this.result; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("result", this.result == null ? null : this.result.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HealthCheck from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HealthCheck if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the HealthCheck. + */ + @Generated + public static HealthCheck fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + HealthCheck deserializedHealthCheck = new HealthCheck(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedHealthCheck.name = reader.getString(); + } else if ("result".equals(fieldName)) { + deserializedHealthCheck.result = HealthCheckResult.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedHealthCheck; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/HealthCheckResult.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/HealthCheckResult.java new file mode 100644 index 000000000000..a86a47ef62d0 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/HealthCheckResult.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Health check result. + */ +public final class HealthCheckResult extends ExpandableStringEnum { + /** + * Health check succeeded. + */ + @Generated + public static final HealthCheckResult SUCCESS = fromString("success"); + + /** + * Health check failed due to user error. + */ + @Generated + public static final HealthCheckResult USER_ERROR = fromString("userError"); + + /** + * Creates a new instance of HealthCheckResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public HealthCheckResult() { + } + + /** + * Creates or finds a HealthCheckResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding HealthCheckResult. + */ + @Generated + public static HealthCheckResult fromString(String name) { + return fromString(name, HealthCheckResult.class); + } + + /** + * Gets known HealthCheckResult values. + * + * @return known HealthCheckResult values. + */ + @Generated + public static Collection values() { + return values(HealthCheckResult.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportManifestMetadata.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportManifestMetadata.java new file mode 100644 index 000000000000..23ff7a2f0273 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportManifestMetadata.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Metadata describing the import manifest, a document which describes the files + * and other metadata about an update version. + */ +@Immutable +public final class ImportManifestMetadata implements JsonSerializable { + /* + * 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. + */ + @Generated + private final String url; + + /* + * File size in number of bytes. + */ + @Generated + private final long sizeInBytes; + + /* + * 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. + */ + @Generated + private final Map hashes; + + /** + * Creates an instance of ImportManifestMetadata class. + * + * @param url the url value to set. + * @param sizeInBytes the sizeInBytes value to set. + * @param hashes the hashes value to set. + */ + @Generated + public ImportManifestMetadata(String url, long sizeInBytes, Map hashes) { + this.url = url; + this.sizeInBytes = sizeInBytes; + this.hashes = hashes; + } + + /** + * Get the url property: 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. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } + + /** + * Get the sizeInBytes property: File size in number of bytes. + * + * @return the sizeInBytes value. + */ + @Generated + public long getSizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get the hashes property: 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. + * + * @return the hashes value. + */ + @Generated + public Map getHashes() { + return this.hashes; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("url", this.url); + jsonWriter.writeLongField("sizeInBytes", this.sizeInBytes); + jsonWriter.writeMapField("hashes", this.hashes, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportManifestMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportManifestMetadata if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImportManifestMetadata. + */ + @Generated + public static ImportManifestMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String url = null; + long sizeInBytes = 0L; + Map hashes = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("url".equals(fieldName)) { + url = reader.getString(); + } else if ("sizeInBytes".equals(fieldName)) { + sizeInBytes = reader.getLong(); + } else if ("hashes".equals(fieldName)) { + hashes = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new ImportManifestMetadata(url, sizeInBytes, hashes); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportType.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportType.java new file mode 100644 index 000000000000..e01f1c8c7193 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportType.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The device import type. + */ +public final class ImportType extends ExpandableStringEnum { + /** + * Import only devices but not modules. + */ + @Generated + public static final ImportType DEVICES = fromString("Devices"); + + /** + * Import only modules but not devices. + */ + @Generated + public static final ImportType MODULES = fromString("Modules"); + + /** + * Import both devices and modules. + */ + @Generated + public static final ImportType ALL = fromString("All"); + + /** + * Creates a new instance of ImportType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ImportType() { + } + + /** + * Creates or finds a ImportType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImportType. + */ + @Generated + public static ImportType fromString(String name) { + return fromString(name, ImportType.class); + } + + /** + * Gets known ImportType values. + * + * @return known ImportType values. + */ + @Generated + public static Collection values() { + return values(ImportType.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportUpdateInputItem.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportUpdateInputItem.java new file mode 100644 index 000000000000..b9458b6bf733 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/ImportUpdateInputItem.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Import update input item metadata. + */ +@Fluent +public final class ImportUpdateInputItem implements JsonSerializable { + /* + * Import manifest metadata like source URL, file size/hashes, etc. + */ + @Generated + private final ImportManifestMetadata importManifest; + + /* + * Friendly update name. + */ + @Generated + private String friendlyName; + + /* + * One or more update file properties like filename and source URL. + */ + @Generated + private List files; + + /** + * Creates an instance of ImportUpdateInputItem class. + * + * @param importManifest the importManifest value to set. + */ + @Generated + public ImportUpdateInputItem(ImportManifestMetadata importManifest) { + this.importManifest = importManifest; + } + + /** + * Get the importManifest property: Import manifest metadata like source URL, file size/hashes, etc. + * + * @return the importManifest value. + */ + @Generated + public ImportManifestMetadata getImportManifest() { + return this.importManifest; + } + + /** + * Get the friendlyName property: Friendly update name. + * + * @return the friendlyName value. + */ + @Generated + public String getFriendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: Friendly update name. + * + * @param friendlyName the friendlyName value to set. + * @return the ImportUpdateInputItem object itself. + */ + @Generated + public ImportUpdateInputItem setFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + return this; + } + + /** + * Get the files property: One or more update file properties like filename and source URL. + * + * @return the files value. + */ + @Generated + public List getFiles() { + return this.files; + } + + /** + * Set the files property: One or more update file properties like filename and source URL. + * + * @param files the files value to set. + * @return the ImportUpdateInputItem object itself. + */ + @Generated + public ImportUpdateInputItem setFiles(List files) { + this.files = files; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("importManifest", this.importManifest); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ImportUpdateInputItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ImportUpdateInputItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ImportUpdateInputItem. + */ + @Generated + public static ImportUpdateInputItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ImportManifestMetadata importManifest = null; + String friendlyName = null; + List files = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("importManifest".equals(fieldName)) { + importManifest = ImportManifestMetadata.fromJson(reader); + } else if ("friendlyName".equals(fieldName)) { + friendlyName = reader.getString(); + } else if ("files".equals(fieldName)) { + files = reader.readArray(reader1 -> FileImportMetadata.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + ImportUpdateInputItem deserializedImportUpdateInputItem = new ImportUpdateInputItem(importManifest); + deserializedImportUpdateInputItem.friendlyName = friendlyName; + deserializedImportUpdateInputItem.files = files; + + return deserializedImportUpdateInputItem; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/InnerError.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/InnerError.java new file mode 100644 index 000000000000..7939c5682926 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/InnerError.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An object containing more specific information than the current object about + * the error. + */ +@Immutable +public final class InnerError implements JsonSerializable { + /* + * A more specific error code than what was provided by the containing error. + */ + @Generated + private final String code; + + /* + * A human-readable representation of the error. + */ + @Generated + private String message; + + /* + * The internal error or exception message. + */ + @Generated + private String errorDetail; + + /* + * An object containing more specific information than the current object about + * the error. + */ + @Generated + private InnerError innerError; + + /** + * Creates an instance of InnerError class. + * + * @param code the code value to set. + */ + @Generated + private InnerError(String code) { + this.code = code; + } + + /** + * Get the code property: A more specific error code than what was provided by the containing error. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: A human-readable representation of the error. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the errorDetail property: The internal error or exception message. + * + * @return the errorDetail value. + */ + @Generated + public String getErrorDetail() { + return this.errorDetail; + } + + /** + * Get the innerError property: An object containing more specific information than the current object about + * the error. + * + * @return the innerError value. + */ + @Generated + public InnerError getInnerError() { + return this.innerError; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("errorDetail", this.errorDetail); + jsonWriter.writeJsonField("innerError", this.innerError); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InnerError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InnerError if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InnerError. + */ + @Generated + public static InnerError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + String errorDetail = null; + InnerError innerError = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("errorDetail".equals(fieldName)) { + errorDetail = reader.getString(); + } else if ("innerError".equals(fieldName)) { + innerError = InnerError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + InnerError deserializedInnerError = new InnerError(code); + deserializedInnerError.message = message; + deserializedInnerError.errorDetail = errorDetail; + deserializedInnerError.innerError = innerError; + + return deserializedInnerError; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/InstallResult.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/InstallResult.java new file mode 100644 index 000000000000..a1cc5382906e --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/InstallResult.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The install result of an update and any step results under it. + */ +@Immutable +public final class InstallResult implements JsonSerializable { + /* + * Install result code. + */ + @Generated + private final int resultCode; + + /* + * Install extended result code + */ + @Generated + private final int extendedResultCode; + + /* + * A string containing further details about the install result + */ + @Generated + private String resultDetails; + + /* + * Array of step results + */ + @Generated + private List stepResults; + + /** + * Creates an instance of InstallResult class. + * + * @param resultCode the resultCode value to set. + * @param extendedResultCode the extendedResultCode value to set. + */ + @Generated + private InstallResult(int resultCode, int extendedResultCode) { + this.resultCode = resultCode; + this.extendedResultCode = extendedResultCode; + } + + /** + * Get the resultCode property: Install result code. + * + * @return the resultCode value. + */ + @Generated + public int getResultCode() { + return this.resultCode; + } + + /** + * Get the extendedResultCode property: Install extended result code. + * + * @return the extendedResultCode value. + */ + @Generated + public int getExtendedResultCode() { + return this.extendedResultCode; + } + + /** + * Get the resultDetails property: A string containing further details about the install result. + * + * @return the resultDetails value. + */ + @Generated + public String getResultDetails() { + return this.resultDetails; + } + + /** + * Get the stepResults property: Array of step results. + * + * @return the stepResults value. + */ + @Generated + public List getStepResults() { + return this.stepResults; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("resultCode", this.resultCode); + jsonWriter.writeIntField("extendedResultCode", this.extendedResultCode); + jsonWriter.writeStringField("resultDetails", this.resultDetails); + jsonWriter.writeArrayField("stepResults", this.stepResults, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InstallResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InstallResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InstallResult. + */ + @Generated + public static InstallResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int resultCode = 0; + int extendedResultCode = 0; + String resultDetails = null; + List stepResults = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultCode".equals(fieldName)) { + resultCode = reader.getInt(); + } else if ("extendedResultCode".equals(fieldName)) { + extendedResultCode = reader.getInt(); + } else if ("resultDetails".equals(fieldName)) { + resultDetails = reader.getString(); + } else if ("stepResults".equals(fieldName)) { + stepResults = reader.readArray(reader1 -> StepResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + InstallResult deserializedInstallResult = new InstallResult(resultCode, extendedResultCode); + deserializedInstallResult.resultDetails = resultDetails; + deserializedInstallResult.stepResults = stepResults; + + return deserializedInstallResult; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Instructions.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Instructions.java new file mode 100644 index 000000000000..d250a6040908 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Instructions.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Update install instructions container. + */ +@Immutable +public final class Instructions implements JsonSerializable { + /* + * Collection of installation steps. + */ + @Generated + private final List steps; + + /** + * Creates an instance of Instructions class. + * + * @param steps the steps value to set. + */ + @Generated + private Instructions(List steps) { + this.steps = steps; + } + + /** + * Get the steps property: Collection of installation steps. + * + * @return the steps value. + */ + @Generated + public List getSteps() { + return this.steps; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("steps", this.steps, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Instructions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Instructions if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Instructions. + */ + @Generated + public static Instructions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List steps = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("steps".equals(fieldName)) { + steps = reader.readArray(reader1 -> Step.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new Instructions(steps); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollection.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollection.java new file mode 100644 index 000000000000..347bf06414ad --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollection.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Diagnostics request body. + */ +@Fluent +public final class LogCollection implements JsonSerializable { + /* + * The log collection id. + */ + @Generated + private String logCollectionId; + + /* + * Array of Device Update agent ids + */ + @Generated + private final List deviceList; + + /* + * Description of the diagnostics operation. + */ + @Generated + private String description; + + /* + * The timestamp when the operation was created. + */ + @Generated + private String createdDateTime; + + /* + * A timestamp for when the current state was entered. + */ + @Generated + private String lastActionDateTime; + + /* + * Operation status. + */ + @Generated + private OperationStatus status; + + /** + * Creates an instance of LogCollection class. + * + * @param deviceList the deviceList value to set. + */ + @Generated + public LogCollection(List deviceList) { + this.deviceList = deviceList; + } + + /** + * Get the logCollectionId property: The log collection id. + * + * @return the logCollectionId value. + */ + @Generated + public String getLogCollectionId() { + return this.logCollectionId; + } + + /** + * Set the logCollectionId property: The log collection id. + * + * @param logCollectionId the logCollectionId value to set. + * @return the LogCollection object itself. + */ + @Generated + public LogCollection setLogCollectionId(String logCollectionId) { + this.logCollectionId = logCollectionId; + return this; + } + + /** + * Get the deviceList property: Array of Device Update agent ids. + * + * @return the deviceList value. + */ + @Generated + public List getDeviceList() { + return this.deviceList; + } + + /** + * Get the description property: Description of the diagnostics operation. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Description of the diagnostics operation. + * + * @param description the description value to set. + * @return the LogCollection object itself. + */ + @Generated + public LogCollection setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the createdDateTime property: The timestamp when the operation was created. + * + * @return the createdDateTime value. + */ + @Generated + public String getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastActionDateTime property: A timestamp for when the current state was entered. + * + * @return the lastActionDateTime value. + */ + @Generated + public String getLastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + @Generated + public OperationStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("deviceList", this.deviceList, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("operationId", this.logCollectionId); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogCollection if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogCollection. + */ + @Generated + public static LogCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List deviceList = null; + String logCollectionId = null; + String description = null; + String createdDateTime = null; + String lastActionDateTime = null; + OperationStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceList".equals(fieldName)) { + deviceList = reader.readArray(reader1 -> DeviceUpdateAgentId.fromJson(reader1)); + } else if ("operationId".equals(fieldName)) { + logCollectionId = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader.getString(); + } else if ("lastActionDateTime".equals(fieldName)) { + lastActionDateTime = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + LogCollection deserializedLogCollection = new LogCollection(deviceList); + deserializedLogCollection.logCollectionId = logCollectionId; + deserializedLogCollection.description = description; + deserializedLogCollection.createdDateTime = createdDateTime; + deserializedLogCollection.lastActionDateTime = lastActionDateTime; + deserializedLogCollection.status = status; + + return deserializedLogCollection; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDetailedStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDetailedStatus.java new file mode 100644 index 000000000000..21e77be07d95 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDetailedStatus.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Device diagnostics operation detailed status. + */ +@Immutable +public final class LogCollectionOperationDetailedStatus + implements JsonSerializable { + /* + * The device diagnostics operation id. + */ + @Generated + private String logCollectionId; + + /* + * The timestamp when the operation was created. + */ + @Generated + private String createdDateTime; + + /* + * A timestamp for when the current state was entered. + */ + @Generated + private String lastActionDateTime; + + /* + * Operation status. + */ + @Generated + private OperationStatus status; + + /* + * Status of the devices in the operation + */ + @Generated + private List deviceStatus; + + /* + * Device diagnostics operation description. + */ + @Generated + private String description; + + /** + * Creates an instance of LogCollectionOperationDetailedStatus class. + */ + @Generated + private LogCollectionOperationDetailedStatus() { + } + + /** + * Get the logCollectionId property: The device diagnostics operation id. + * + * @return the logCollectionId value. + */ + @Generated + public String getLogCollectionId() { + return this.logCollectionId; + } + + /** + * Get the createdDateTime property: The timestamp when the operation was created. + * + * @return the createdDateTime value. + */ + @Generated + public String getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the lastActionDateTime property: A timestamp for when the current state was entered. + * + * @return the lastActionDateTime value. + */ + @Generated + public String getLastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + @Generated + public OperationStatus getStatus() { + return this.status; + } + + /** + * Get the deviceStatus property: Status of the devices in the operation. + * + * @return the deviceStatus value. + */ + @Generated + public List getDeviceStatus() { + return this.deviceStatus; + } + + /** + * Get the description property: Device diagnostics operation description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.logCollectionId); + jsonWriter.writeStringField("createdDateTime", this.createdDateTime); + jsonWriter.writeStringField("lastActionDateTime", this.lastActionDateTime); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("deviceStatus", this.deviceStatus, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogCollectionOperationDetailedStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogCollectionOperationDetailedStatus if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LogCollectionOperationDetailedStatus. + */ + @Generated + public static LogCollectionOperationDetailedStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogCollectionOperationDetailedStatus deserializedLogCollectionOperationDetailedStatus + = new LogCollectionOperationDetailedStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + deserializedLogCollectionOperationDetailedStatus.logCollectionId = reader.getString(); + } else if ("createdDateTime".equals(fieldName)) { + deserializedLogCollectionOperationDetailedStatus.createdDateTime = reader.getString(); + } else if ("lastActionDateTime".equals(fieldName)) { + deserializedLogCollectionOperationDetailedStatus.lastActionDateTime = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedLogCollectionOperationDetailedStatus.status + = OperationStatus.fromString(reader.getString()); + } else if ("deviceStatus".equals(fieldName)) { + List deviceStatus + = reader.readArray(reader1 -> LogCollectionOperationDeviceStatus.fromJson(reader1)); + deserializedLogCollectionOperationDetailedStatus.deviceStatus = deviceStatus; + } else if ("description".equals(fieldName)) { + deserializedLogCollectionOperationDetailedStatus.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLogCollectionOperationDetailedStatus; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDeviceStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDeviceStatus.java new file mode 100644 index 000000000000..62643b18c862 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDeviceStatus.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Diagnostics operation device status. + */ +@Immutable +public final class LogCollectionOperationDeviceStatus implements JsonSerializable { + /* + * Device id + */ + @Generated + private final String deviceId; + + /* + * Module id. + */ + @Generated + private String moduleId; + + /* + * Log upload status + */ + @Generated + private final OperationStatus status; + + /* + * Log upload result code + */ + @Generated + private String resultCode; + + /* + * Log upload extended result code + */ + @Generated + private String extendedResultCode; + + /* + * Log upload location + */ + @Generated + private String logLocation; + + /** + * Creates an instance of LogCollectionOperationDeviceStatus class. + * + * @param deviceId the deviceId value to set. + * @param status the status value to set. + */ + @Generated + private LogCollectionOperationDeviceStatus(String deviceId, OperationStatus status) { + this.deviceId = deviceId; + this.status = status; + } + + /** + * Get the deviceId property: Device id. + * + * @return the deviceId value. + */ + @Generated + public String getDeviceId() { + return this.deviceId; + } + + /** + * Get the moduleId property: Module id. + * + * @return the moduleId value. + */ + @Generated + public String getModuleId() { + return this.moduleId; + } + + /** + * Get the status property: Log upload status. + * + * @return the status value. + */ + @Generated + public OperationStatus getStatus() { + return this.status; + } + + /** + * Get the resultCode property: Log upload result code. + * + * @return the resultCode value. + */ + @Generated + public String getResultCode() { + return this.resultCode; + } + + /** + * Get the extendedResultCode property: Log upload extended result code. + * + * @return the extendedResultCode value. + */ + @Generated + public String getExtendedResultCode() { + return this.extendedResultCode; + } + + /** + * Get the logLocation property: Log upload location. + * + * @return the logLocation value. + */ + @Generated + public String getLogLocation() { + return this.logLocation; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("deviceId", this.deviceId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("moduleId", this.moduleId); + jsonWriter.writeStringField("resultCode", this.resultCode); + jsonWriter.writeStringField("extendedResultCode", this.extendedResultCode); + jsonWriter.writeStringField("logLocation", this.logLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogCollectionOperationDeviceStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogCollectionOperationDeviceStatus if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LogCollectionOperationDeviceStatus. + */ + @Generated + public static LogCollectionOperationDeviceStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String deviceId = null; + OperationStatus status = null; + String moduleId = null; + String resultCode = null; + String extendedResultCode = null; + String logLocation = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("deviceId".equals(fieldName)) { + deviceId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationStatus.fromString(reader.getString()); + } else if ("moduleId".equals(fieldName)) { + moduleId = reader.getString(); + } else if ("resultCode".equals(fieldName)) { + resultCode = reader.getString(); + } else if ("extendedResultCode".equals(fieldName)) { + extendedResultCode = reader.getString(); + } else if ("logLocation".equals(fieldName)) { + logLocation = reader.getString(); + } else { + reader.skipChildren(); + } + } + LogCollectionOperationDeviceStatus deserializedLogCollectionOperationDeviceStatus + = new LogCollectionOperationDeviceStatus(deviceId, status); + deserializedLogCollectionOperationDeviceStatus.moduleId = moduleId; + deserializedLogCollectionOperationDeviceStatus.resultCode = resultCode; + deserializedLogCollectionOperationDeviceStatus.extendedResultCode = extendedResultCode; + deserializedLogCollectionOperationDeviceStatus.logLocation = logLocation; + + return deserializedLogCollectionOperationDeviceStatus; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/OperationStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/OperationStatus.java new file mode 100644 index 000000000000..97bc40867749 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/OperationStatus.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Operation status. + */ +public final class OperationStatus extends ExpandableStringEnum { + /** + * Background operation created but not started yet. + */ + @Generated + public static final OperationStatus NOT_STARTED = fromString("NotStarted"); + + /** + * Background operation is currently running. + */ + @Generated + public static final OperationStatus RUNNING = fromString("Running"); + + /** + * Background operation finished with success. + */ + @Generated + public static final OperationStatus SUCCEEDED = fromString("Succeeded"); + + /** + * Background operation finished with failure. + */ + @Generated + public static final OperationStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of OperationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OperationStatus() { + } + + /** + * Creates or finds a OperationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationStatus. + */ + @Generated + public static OperationStatus fromString(String name) { + return fromString(name, OperationStatus.class); + } + + /** + * Gets known OperationStatus values. + * + * @return known OperationStatus values. + */ + @Generated + public static Collection values() { + return values(OperationStatus.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/PatchBody.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/PatchBody.java new file mode 100644 index 000000000000..0d95a0a32efc --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/PatchBody.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.iot.deviceupdate.implementation.JsonMergePatchHelper; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * Device Class JSON Merge Patch request body. + */ +@Fluent +public final class PatchBody implements JsonSerializable { + /* + * The device class friendly name. Friendly name can be 1-100 characters, + * alphanumeric, dot, and dash. + */ + @Generated + private String friendlyName; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper.setPatchBodyAccessor(new JsonMergePatchHelper.PatchBodyAccessor() { + @Override + public PatchBody prepareModelForJsonMergePatch(PatchBody model, boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(PatchBody model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of PatchBody class. + */ + @Generated + public PatchBody() { + } + + /** + * Get the friendlyName property: The device class friendly name. Friendly name can be 1-100 characters, + * alphanumeric, dot, and dash. + * + * @return the friendlyName value. + */ + @Generated + public String getFriendlyName() { + return this.friendlyName; + } + + /** + * Set the friendlyName property: The device class friendly name. Friendly name can be 1-100 characters, + * alphanumeric, dot, and dash. + *

Required when create the resource.

+ * + * @param friendlyName the friendlyName value to set. + * @return the PatchBody object itself. + */ + @Generated + public PatchBody setFriendlyName(String friendlyName) { + this.friendlyName = friendlyName; + this.updatedProperties.add("friendlyName"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("friendlyName")) { + if (this.friendlyName == null) { + jsonWriter.writeNullField("friendlyName"); + } else { + jsonWriter.writeStringField("friendlyName", this.friendlyName); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PatchBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PatchBody if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the PatchBody. + */ + @Generated + public static PatchBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PatchBody deserializedPatchBody = new PatchBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("friendlyName".equals(fieldName)) { + deserializedPatchBody.friendlyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPatchBody; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Step.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Step.java new file mode 100644 index 000000000000..43ddc18a85cf --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Step.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Update install instruction step. + */ +@Immutable +public final class Step implements JsonSerializable { + /* + * Step type. + */ + @Generated + private StepType type; + + /* + * Step description. + */ + @Generated + private String description; + + /* + * Identity of handler that will execute this step. Required if step type is + * inline. + */ + @Generated + private String handler; + + /* + * Parameters to be passed to handler during execution. + */ + @Generated + private Map handlerProperties; + + /* + * Collection of file names to be passed to handler during execution. Required if + * step type is inline. + */ + @Generated + private List files; + + /* + * Referenced child update identity. Required if step type is reference. + */ + @Generated + private UpdateId updateId; + + /** + * Creates an instance of Step class. + */ + @Generated + private Step() { + } + + /** + * Get the type property: Step type. + * + * @return the type value. + */ + @Generated + public StepType getType() { + return this.type; + } + + /** + * Get the description property: Step description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the handler property: Identity of handler that will execute this step. Required if step type is + * inline. + * + * @return the handler value. + */ + @Generated + public String getHandler() { + return this.handler; + } + + /** + * Get the handlerProperties property: Parameters to be passed to handler during execution. + * + * @return the handlerProperties value. + */ + @Generated + public Map getHandlerProperties() { + return this.handlerProperties; + } + + /** + * Get the files property: Collection of file names to be passed to handler during execution. Required if + * step type is inline. + * + * @return the files value. + */ + @Generated + public List getFiles() { + return this.files; + } + + /** + * Get the updateId property: Referenced child update identity. Required if step type is reference. + * + * @return the updateId value. + */ + @Generated + public UpdateId getUpdateId() { + return this.updateId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("handler", this.handler); + jsonWriter.writeMapField("handlerProperties", this.handlerProperties, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("updateId", this.updateId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Step from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Step if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IOException If an error occurs while reading the Step. + */ + @Generated + public static Step fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Step deserializedStep = new Step(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("type".equals(fieldName)) { + deserializedStep.type = StepType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedStep.description = reader.getString(); + } else if ("handler".equals(fieldName)) { + deserializedStep.handler = reader.getString(); + } else if ("handlerProperties".equals(fieldName)) { + Map handlerProperties = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedStep.handlerProperties = handlerProperties; + } else if ("files".equals(fieldName)) { + List files = reader.readArray(reader1 -> reader1.getString()); + deserializedStep.files = files; + } else if ("updateId".equals(fieldName)) { + deserializedStep.updateId = UpdateId.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedStep; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/StepResult.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/StepResult.java new file mode 100644 index 000000000000..4ab3f04816b9 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/StepResult.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The step result under an update. + */ +@Immutable +public final class StepResult implements JsonSerializable { + /* + * The update that this step installs if it is of reference type. + */ + @Generated + private UpdateInfo update; + + /* + * Step description. + */ + @Generated + private String description; + + /* + * Install result code. + */ + @Generated + private final int resultCode; + + /* + * Install extended result code + */ + @Generated + private final int extendedResultCode; + + /* + * A string containing further details about the install result + */ + @Generated + private String resultDetails; + + /** + * Creates an instance of StepResult class. + * + * @param resultCode the resultCode value to set. + * @param extendedResultCode the extendedResultCode value to set. + */ + @Generated + private StepResult(int resultCode, int extendedResultCode) { + this.resultCode = resultCode; + this.extendedResultCode = extendedResultCode; + } + + /** + * Get the update property: The update that this step installs if it is of reference type. + * + * @return the update value. + */ + @Generated + public UpdateInfo getUpdate() { + return this.update; + } + + /** + * Get the description property: Step description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the resultCode property: Install result code. + * + * @return the resultCode value. + */ + @Generated + public int getResultCode() { + return this.resultCode; + } + + /** + * Get the extendedResultCode property: Install extended result code. + * + * @return the extendedResultCode value. + */ + @Generated + public int getExtendedResultCode() { + return this.extendedResultCode; + } + + /** + * Get the resultDetails property: A string containing further details about the install result. + * + * @return the resultDetails value. + */ + @Generated + public String getResultDetails() { + return this.resultDetails; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("resultCode", this.resultCode); + jsonWriter.writeIntField("extendedResultCode", this.extendedResultCode); + jsonWriter.writeJsonField("update", this.update); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("resultDetails", this.resultDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StepResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StepResult if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the StepResult. + */ + @Generated + public static StepResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int resultCode = 0; + int extendedResultCode = 0; + UpdateInfo update = null; + String description = null; + String resultDetails = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultCode".equals(fieldName)) { + resultCode = reader.getInt(); + } else if ("extendedResultCode".equals(fieldName)) { + extendedResultCode = reader.getInt(); + } else if ("update".equals(fieldName)) { + update = UpdateInfo.fromJson(reader); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("resultDetails".equals(fieldName)) { + resultDetails = reader.getString(); + } else { + reader.skipChildren(); + } + } + StepResult deserializedStepResult = new StepResult(resultCode, extendedResultCode); + deserializedStepResult.update = update; + deserializedStepResult.description = description; + deserializedStepResult.resultDetails = resultDetails; + + return deserializedStepResult; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/StepType.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/StepType.java new file mode 100644 index 000000000000..7371f7d334da --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/StepType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Step type. + */ +public final class StepType extends ExpandableStringEnum { + /** + * Step type that performs code execution. + */ + @Generated + public static final StepType INLINE = fromString("inline"); + + /** + * Step type that installs another update. + */ + @Generated + public static final StepType REFERENCE = fromString("reference"); + + /** + * Creates a new instance of StepType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public StepType() { + } + + /** + * Creates or finds a StepType from its string representation. + * + * @param name a name to look for. + * @return the corresponding StepType. + */ + @Generated + public static StepType fromString(String name) { + return fromString(name, StepType.class); + } + + /** + * Gets known StepType values. + * + * @return known StepType values. + */ + @Generated + public static Collection values() { + return values(StepType.class); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Update.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Update.java new file mode 100644 index 000000000000..22f44825cea8 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/Update.java @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Update metadata. + */ +@Immutable +public final class Update implements JsonSerializable { + /* + * Update identity. + */ + @Generated + private final UpdateId updateId; + + /* + * Update description specified by creator. + */ + @Generated + private String description; + + /* + * Friendly update name specified by importer. + */ + @Generated + private String friendlyName; + + /* + * Whether the update can be deployed to a device on its own. + */ + @Generated + private Boolean isDeployable; + + /* + * Update type. Deprecated in latest import manifest schema. + */ + @Generated + private String updateType; + + /* + * String interpreted by Device Update client to determine if the update is + * installed on the device. Deprecated in latest import manifest schema. + */ + @Generated + private String installedCriteria; + + /* + * List of update compatibility information. + */ + @Generated + private final List compatibility; + + /* + * Update install instructions. + */ + @Generated + private Instructions instructions; + + /* + * List of update identities that reference this update. + */ + @Generated + private List referencedBy; + + /* + * Update aggregate scan result (calculated from payload file scan results). + */ + @Generated + private String scanResult; + + /* + * Schema version of manifest used to import the update. + */ + @Generated + private final String manifestVersion; + + /* + * Date and time in UTC when the update was imported. + */ + @Generated + private final OffsetDateTime importedDateTime; + + /* + * Date and time in UTC when the update was created. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * Update ETag. + */ + @Generated + private String etag; + + /** + * Creates an instance of Update class. + * + * @param updateId the updateId value to set. + * @param compatibility the compatibility value to set. + * @param manifestVersion the manifestVersion value to set. + * @param importedDateTime the importedDateTime value to set. + * @param createdDateTime the createdDateTime value to set. + */ + @Generated + private Update(UpdateId updateId, List compatibility, String manifestVersion, + OffsetDateTime importedDateTime, OffsetDateTime createdDateTime) { + this.updateId = updateId; + this.compatibility = compatibility; + this.manifestVersion = manifestVersion; + this.importedDateTime = importedDateTime; + this.createdDateTime = createdDateTime; + } + + /** + * Get the updateId property: Update identity. + * + * @return the updateId value. + */ + @Generated + public UpdateId getUpdateId() { + return this.updateId; + } + + /** + * Get the description property: Update description specified by creator. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the friendlyName property: Friendly update name specified by importer. + * + * @return the friendlyName value. + */ + @Generated + public String getFriendlyName() { + return this.friendlyName; + } + + /** + * Get the isDeployable property: Whether the update can be deployed to a device on its own. + * + * @return the isDeployable value. + */ + @Generated + public Boolean isDeployable() { + return this.isDeployable; + } + + /** + * Get the updateType property: Update type. Deprecated in latest import manifest schema. + * + * @return the updateType value. + */ + @Generated + public String getUpdateType() { + return this.updateType; + } + + /** + * Get the installedCriteria property: String interpreted by Device Update client to determine if the update is + * installed on the device. Deprecated in latest import manifest schema. + * + * @return the installedCriteria value. + */ + @Generated + public String getInstalledCriteria() { + return this.installedCriteria; + } + + /** + * Get the compatibility property: List of update compatibility information. + * + * @return the compatibility value. + */ + @Generated + public List getCompatibility() { + return this.compatibility; + } + + /** + * Get the instructions property: Update install instructions. + * + * @return the instructions value. + */ + @Generated + public Instructions getInstructions() { + return this.instructions; + } + + /** + * Get the referencedBy property: List of update identities that reference this update. + * + * @return the referencedBy value. + */ + @Generated + public List getReferencedBy() { + return this.referencedBy; + } + + /** + * Get the scanResult property: Update aggregate scan result (calculated from payload file scan results). + * + * @return the scanResult value. + */ + @Generated + public String getScanResult() { + return this.scanResult; + } + + /** + * Get the manifestVersion property: Schema version of manifest used to import the update. + * + * @return the manifestVersion value. + */ + @Generated + public String getManifestVersion() { + return this.manifestVersion; + } + + /** + * Get the importedDateTime property: Date and time in UTC when the update was imported. + * + * @return the importedDateTime value. + */ + @Generated + public OffsetDateTime getImportedDateTime() { + return this.importedDateTime; + } + + /** + * Get the createdDateTime property: Date and time in UTC when the update was created. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the etag property: Update ETag. + * + * @return the etag value. + */ + @Generated + public String getEtag() { + return this.etag; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("updateId", this.updateId); + jsonWriter.writeArrayField("compatibility", this.compatibility, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("manifestVersion", this.manifestVersion); + jsonWriter.writeStringField("importedDateTime", + this.importedDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.importedDateTime)); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("friendlyName", this.friendlyName); + jsonWriter.writeBooleanField("isDeployable", this.isDeployable); + jsonWriter.writeStringField("updateType", this.updateType); + jsonWriter.writeStringField("installedCriteria", this.installedCriteria); + jsonWriter.writeJsonField("instructions", this.instructions); + jsonWriter.writeArrayField("referencedBy", this.referencedBy, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("scanResult", this.scanResult); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Update from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Update if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Update. + */ + @Generated + public static Update fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateId updateId = null; + List compatibility = null; + String manifestVersion = null; + OffsetDateTime importedDateTime = null; + OffsetDateTime createdDateTime = null; + String description = null; + String friendlyName = null; + Boolean isDeployable = null; + String updateType = null; + String installedCriteria = null; + Instructions instructions = null; + List referencedBy = null; + String scanResult = null; + String etag = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("updateId".equals(fieldName)) { + updateId = UpdateId.fromJson(reader); + } else if ("compatibility".equals(fieldName)) { + compatibility = reader.readArray(reader1 -> Compatibility.fromJson(reader1)); + } else if ("manifestVersion".equals(fieldName)) { + manifestVersion = reader.getString(); + } else if ("importedDateTime".equals(fieldName)) { + importedDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + friendlyName = reader.getString(); + } else if ("isDeployable".equals(fieldName)) { + isDeployable = reader.getNullable(JsonReader::getBoolean); + } else if ("updateType".equals(fieldName)) { + updateType = reader.getString(); + } else if ("installedCriteria".equals(fieldName)) { + installedCriteria = reader.getString(); + } else if ("instructions".equals(fieldName)) { + instructions = Instructions.fromJson(reader); + } else if ("referencedBy".equals(fieldName)) { + referencedBy = reader.readArray(reader1 -> UpdateId.fromJson(reader1)); + } else if ("scanResult".equals(fieldName)) { + scanResult = reader.getString(); + } else if ("etag".equals(fieldName)) { + etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + Update deserializedUpdate + = new Update(updateId, compatibility, manifestVersion, importedDateTime, createdDateTime); + deserializedUpdate.description = description; + deserializedUpdate.friendlyName = friendlyName; + deserializedUpdate.isDeployable = isDeployable; + deserializedUpdate.updateType = updateType; + deserializedUpdate.installedCriteria = installedCriteria; + deserializedUpdate.instructions = instructions; + deserializedUpdate.referencedBy = referencedBy; + deserializedUpdate.scanResult = scanResult; + deserializedUpdate.etag = etag; + + return deserializedUpdate; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateCompliance.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateCompliance.java new file mode 100644 index 000000000000..d39fd306e42a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateCompliance.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Update compliance information. + */ +@Immutable +public final class UpdateCompliance implements JsonSerializable { + /* + * Total number of devices. + */ + @Generated + private final int totalDeviceCount; + + /* + * Number of devices on the latest update. + */ + @Generated + private final int onLatestUpdateDeviceCount; + + /* + * Number of devices with a newer update available. + */ + @Generated + private final int newUpdatesAvailableDeviceCount; + + /* + * Number of devices with update in-progress. + */ + @Generated + private final int updatesInProgressDeviceCount; + + /** + * Creates an instance of UpdateCompliance class. + * + * @param totalDeviceCount the totalDeviceCount value to set. + * @param onLatestUpdateDeviceCount the onLatestUpdateDeviceCount value to set. + * @param newUpdatesAvailableDeviceCount the newUpdatesAvailableDeviceCount value to set. + * @param updatesInProgressDeviceCount the updatesInProgressDeviceCount value to set. + */ + @Generated + private UpdateCompliance(int totalDeviceCount, int onLatestUpdateDeviceCount, int newUpdatesAvailableDeviceCount, + int updatesInProgressDeviceCount) { + this.totalDeviceCount = totalDeviceCount; + this.onLatestUpdateDeviceCount = onLatestUpdateDeviceCount; + this.newUpdatesAvailableDeviceCount = newUpdatesAvailableDeviceCount; + this.updatesInProgressDeviceCount = updatesInProgressDeviceCount; + } + + /** + * Get the totalDeviceCount property: Total number of devices. + * + * @return the totalDeviceCount value. + */ + @Generated + public int getTotalDeviceCount() { + return this.totalDeviceCount; + } + + /** + * Get the onLatestUpdateDeviceCount property: Number of devices on the latest update. + * + * @return the onLatestUpdateDeviceCount value. + */ + @Generated + public int getOnLatestUpdateDeviceCount() { + return this.onLatestUpdateDeviceCount; + } + + /** + * Get the newUpdatesAvailableDeviceCount property: Number of devices with a newer update available. + * + * @return the newUpdatesAvailableDeviceCount value. + */ + @Generated + public int getNewUpdatesAvailableDeviceCount() { + return this.newUpdatesAvailableDeviceCount; + } + + /** + * Get the updatesInProgressDeviceCount property: Number of devices with update in-progress. + * + * @return the updatesInProgressDeviceCount value. + */ + @Generated + public int getUpdatesInProgressDeviceCount() { + return this.updatesInProgressDeviceCount; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("totalDeviceCount", this.totalDeviceCount); + jsonWriter.writeIntField("onLatestUpdateDeviceCount", this.onLatestUpdateDeviceCount); + jsonWriter.writeIntField("newUpdatesAvailableDeviceCount", this.newUpdatesAvailableDeviceCount); + jsonWriter.writeIntField("updatesInProgressDeviceCount", this.updatesInProgressDeviceCount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateCompliance from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateCompliance if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateCompliance. + */ + @Generated + public static UpdateCompliance fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int totalDeviceCount = 0; + int onLatestUpdateDeviceCount = 0; + int newUpdatesAvailableDeviceCount = 0; + int updatesInProgressDeviceCount = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalDeviceCount".equals(fieldName)) { + totalDeviceCount = reader.getInt(); + } else if ("onLatestUpdateDeviceCount".equals(fieldName)) { + onLatestUpdateDeviceCount = reader.getInt(); + } else if ("newUpdatesAvailableDeviceCount".equals(fieldName)) { + newUpdatesAvailableDeviceCount = reader.getInt(); + } else if ("updatesInProgressDeviceCount".equals(fieldName)) { + updatesInProgressDeviceCount = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new UpdateCompliance(totalDeviceCount, onLatestUpdateDeviceCount, newUpdatesAvailableDeviceCount, + updatesInProgressDeviceCount); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFile.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFile.java new file mode 100644 index 000000000000..c2389bcd991f --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFile.java @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Update file metadata. + */ +@Immutable +public final class UpdateFile extends UpdateFileBase { + /* + * File identity, generated by server at import time. + */ + @Generated + private final String fileId; + + /* + * Optional related files metadata used together DownloadHandler metadata to + * download payload file. + */ + @Generated + private List relatedFiles; + + /* + * Optional download handler for utilizing related files to download payload file. + */ + @Generated + private UpdateFileDownloadHandler downloadHandler; + + /* + * File ETag. + */ + @Generated + private String etag; + + /* + * Optional file properties (not consumed by service but pass-through to device). + */ + @Generated + private Map properties; + + /* + * Anti-malware scan details. + */ + @Generated + private String scanDetails; + + /* + * Anti-malware scan result. + */ + @Generated + private String scanResult; + + /* + * File MIME type. + */ + @Generated + private String mimeType; + + /** + * Creates an instance of UpdateFile class. + * + * @param fileName the fileName value to set. + * @param sizeInBytes the sizeInBytes value to set. + * @param hashes the hashes value to set. + * @param fileId the fileId value to set. + */ + @Generated + private UpdateFile(String fileName, long sizeInBytes, Map hashes, String fileId) { + super(fileName, sizeInBytes, hashes); + this.fileId = fileId; + } + + /** + * Get the fileId property: File identity, generated by server at import time. + * + * @return the fileId value. + */ + @Generated + public String getFileId() { + return this.fileId; + } + + /** + * Get the relatedFiles property: Optional related files metadata used together DownloadHandler metadata to + * download payload file. + * + * @return the relatedFiles value. + */ + @Generated + public List getRelatedFiles() { + return this.relatedFiles; + } + + /** + * Get the downloadHandler property: Optional download handler for utilizing related files to download payload file. + * + * @return the downloadHandler value. + */ + @Generated + public UpdateFileDownloadHandler getDownloadHandler() { + return this.downloadHandler; + } + + /** + * Get the etag property: File ETag. + * + * @return the etag value. + */ + @Generated + public String getEtag() { + return this.etag; + } + + /** + * Get the properties property: Optional file properties (not consumed by service but pass-through to device). + * + * @return the properties value. + */ + @Generated + @Override + public Map getProperties() { + return this.properties; + } + + /** + * Get the scanDetails property: Anti-malware scan details. + * + * @return the scanDetails value. + */ + @Generated + @Override + public String getScanDetails() { + return this.scanDetails; + } + + /** + * Get the scanResult property: Anti-malware scan result. + * + * @return the scanResult value. + */ + @Generated + @Override + public String getScanResult() { + return this.scanResult; + } + + /** + * Get the mimeType property: File MIME type. + * + * @return the mimeType value. + */ + @Generated + @Override + public String getMimeType() { + return this.mimeType; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fileName", getFileName()); + jsonWriter.writeLongField("sizeInBytes", getSizeInBytes()); + jsonWriter.writeMapField("hashes", getHashes(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("mimeType", getMimeType()); + jsonWriter.writeStringField("scanResult", getScanResult()); + jsonWriter.writeStringField("scanDetails", getScanDetails()); + jsonWriter.writeMapField("properties", getProperties(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("fileId", this.fileId); + jsonWriter.writeArrayField("relatedFiles", this.relatedFiles, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("downloadHandler", this.downloadHandler); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateFile if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateFile. + */ + @Generated + public static UpdateFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String fileName = null; + long sizeInBytes = 0L; + Map hashes = null; + String mimeType = null; + String scanResult = null; + String scanDetails = null; + Map properties = null; + String fileId = null; + List relatedFiles = null; + UpdateFileDownloadHandler downloadHandler = null; + String etag = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileName".equals(fieldName)) { + fileName = reader.getString(); + } else if ("sizeInBytes".equals(fieldName)) { + sizeInBytes = reader.getLong(); + } else if ("hashes".equals(fieldName)) { + hashes = reader.readMap(reader1 -> reader1.getString()); + } else if ("mimeType".equals(fieldName)) { + mimeType = reader.getString(); + } else if ("scanResult".equals(fieldName)) { + scanResult = reader.getString(); + } else if ("scanDetails".equals(fieldName)) { + scanDetails = reader.getString(); + } else if ("properties".equals(fieldName)) { + properties = reader.readMap(reader1 -> reader1.getString()); + } else if ("fileId".equals(fieldName)) { + fileId = reader.getString(); + } else if ("relatedFiles".equals(fieldName)) { + relatedFiles = reader.readArray(reader1 -> UpdateFileBase.fromJson(reader1)); + } else if ("downloadHandler".equals(fieldName)) { + downloadHandler = UpdateFileDownloadHandler.fromJson(reader); + } else if ("etag".equals(fieldName)) { + etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + UpdateFile deserializedUpdateFile = new UpdateFile(fileName, sizeInBytes, hashes, fileId); + deserializedUpdateFile.mimeType = mimeType; + deserializedUpdateFile.scanResult = scanResult; + deserializedUpdateFile.scanDetails = scanDetails; + deserializedUpdateFile.properties = properties; + deserializedUpdateFile.relatedFiles = relatedFiles; + deserializedUpdateFile.downloadHandler = downloadHandler; + deserializedUpdateFile.etag = etag; + + return deserializedUpdateFile; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFileBase.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFileBase.java new file mode 100644 index 000000000000..a59fc9e3e566 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFileBase.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Update file basic metadata. + */ +@Immutable +public class UpdateFileBase implements JsonSerializable { + /* + * File name. + */ + @Generated + private final String fileName; + + /* + * File size in number of bytes. + */ + @Generated + private final long sizeInBytes; + + /* + * Mapping of hashing algorithm to base64 encoded hash values. + */ + @Generated + private final Map hashes; + + /* + * File MIME type. + */ + @Generated + private String mimeType; + + /* + * Anti-malware scan result. + */ + @Generated + private String scanResult; + + /* + * Anti-malware scan details. + */ + @Generated + private String scanDetails; + + /* + * Optional file properties (not consumed by service but pass-through to device). + */ + @Generated + private Map properties; + + /** + * Creates an instance of UpdateFileBase class. + * + * @param fileName the fileName value to set. + * @param sizeInBytes the sizeInBytes value to set. + * @param hashes the hashes value to set. + */ + @Generated + protected UpdateFileBase(String fileName, long sizeInBytes, Map hashes) { + this.fileName = fileName; + this.sizeInBytes = sizeInBytes; + this.hashes = hashes; + } + + /** + * Get the fileName property: File name. + * + * @return the fileName value. + */ + @Generated + public String getFileName() { + return this.fileName; + } + + /** + * Get the sizeInBytes property: File size in number of bytes. + * + * @return the sizeInBytes value. + */ + @Generated + public long getSizeInBytes() { + return this.sizeInBytes; + } + + /** + * Get the hashes property: Mapping of hashing algorithm to base64 encoded hash values. + * + * @return the hashes value. + */ + @Generated + public Map getHashes() { + return this.hashes; + } + + /** + * Get the mimeType property: File MIME type. + * + * @return the mimeType value. + */ + @Generated + public String getMimeType() { + return this.mimeType; + } + + /** + * Set the mimeType property: File MIME type. + * + * @param mimeType the mimeType value to set. + * @return the UpdateFileBase object itself. + */ + @Generated + UpdateFileBase setMimeType(String mimeType) { + this.mimeType = mimeType; + return this; + } + + /** + * Get the scanResult property: Anti-malware scan result. + * + * @return the scanResult value. + */ + @Generated + public String getScanResult() { + return this.scanResult; + } + + /** + * Set the scanResult property: Anti-malware scan result. + * + * @param scanResult the scanResult value to set. + * @return the UpdateFileBase object itself. + */ + @Generated + UpdateFileBase setScanResult(String scanResult) { + this.scanResult = scanResult; + return this; + } + + /** + * Get the scanDetails property: Anti-malware scan details. + * + * @return the scanDetails value. + */ + @Generated + public String getScanDetails() { + return this.scanDetails; + } + + /** + * Set the scanDetails property: Anti-malware scan details. + * + * @param scanDetails the scanDetails value to set. + * @return the UpdateFileBase object itself. + */ + @Generated + UpdateFileBase setScanDetails(String scanDetails) { + this.scanDetails = scanDetails; + return this; + } + + /** + * Get the properties property: Optional file properties (not consumed by service but pass-through to device). + * + * @return the properties value. + */ + @Generated + public Map getProperties() { + return this.properties; + } + + /** + * Set the properties property: Optional file properties (not consumed by service but pass-through to device). + * + * @param properties the properties value to set. + * @return the UpdateFileBase object itself. + */ + @Generated + UpdateFileBase setProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("fileName", this.fileName); + jsonWriter.writeLongField("sizeInBytes", this.sizeInBytes); + jsonWriter.writeMapField("hashes", this.hashes, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("mimeType", this.mimeType); + jsonWriter.writeStringField("scanResult", this.scanResult); + jsonWriter.writeStringField("scanDetails", this.scanDetails); + jsonWriter.writeMapField("properties", this.properties, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateFileBase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateFileBase if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateFileBase. + */ + @Generated + public static UpdateFileBase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String fileName = null; + long sizeInBytes = 0L; + Map hashes = null; + String mimeType = null; + String scanResult = null; + String scanDetails = null; + Map properties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("fileName".equals(fieldName)) { + fileName = reader.getString(); + } else if ("sizeInBytes".equals(fieldName)) { + sizeInBytes = reader.getLong(); + } else if ("hashes".equals(fieldName)) { + hashes = reader.readMap(reader1 -> reader1.getString()); + } else if ("mimeType".equals(fieldName)) { + mimeType = reader.getString(); + } else if ("scanResult".equals(fieldName)) { + scanResult = reader.getString(); + } else if ("scanDetails".equals(fieldName)) { + scanDetails = reader.getString(); + } else if ("properties".equals(fieldName)) { + properties = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + UpdateFileBase deserializedUpdateFileBase = new UpdateFileBase(fileName, sizeInBytes, hashes); + deserializedUpdateFileBase.mimeType = mimeType; + deserializedUpdateFileBase.scanResult = scanResult; + deserializedUpdateFileBase.scanDetails = scanDetails; + deserializedUpdateFileBase.properties = properties; + + return deserializedUpdateFileBase; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFileDownloadHandler.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFileDownloadHandler.java new file mode 100644 index 000000000000..2763ff67299a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateFileDownloadHandler.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Download handler for utilizing related files to download payload file. + */ +@Immutable +public final class UpdateFileDownloadHandler implements JsonSerializable { + /* + * Download handler identifier. + */ + @Generated + private final String id; + + /** + * Creates an instance of UpdateFileDownloadHandler class. + * + * @param id the id value to set. + */ + @Generated + private UpdateFileDownloadHandler(String id) { + this.id = id; + } + + /** + * Get the id property: Download handler identifier. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateFileDownloadHandler from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateFileDownloadHandler if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateFileDownloadHandler. + */ + @Generated + public static UpdateFileDownloadHandler fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new UpdateFileDownloadHandler(id); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateId.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateId.java new file mode 100644 index 000000000000..36e58f4ba87d --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateId.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Update identifier. + */ +@Immutable +public final class UpdateId implements JsonSerializable { + /* + * Update provider. + */ + @Generated + private final String provider; + + /* + * Update name. + */ + @Generated + private final String name; + + /* + * Update version. + */ + @Generated + private final String version; + + /** + * Creates an instance of UpdateId class. + * + * @param provider the provider value to set. + * @param name the name value to set. + * @param version the version value to set. + */ + @Generated + public UpdateId(String provider, String name, String version) { + this.provider = provider; + this.name = name; + this.version = version; + } + + /** + * Get the provider property: Update provider. + * + * @return the provider value. + */ + @Generated + public String getProvider() { + return this.provider; + } + + /** + * Get the name property: Update name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: Update version. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateId if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateId. + */ + @Generated + public static UpdateId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String provider = null; + String name = null; + String version = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + provider = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new UpdateId(provider, name, version); + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateInfo.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateInfo.java new file mode 100644 index 000000000000..a271c02a6023 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateInfo.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Update information. + */ +@Immutable +public final class UpdateInfo implements JsonSerializable { + /* + * Update identifier. + */ + @Generated + private final UpdateId updateId; + + /* + * Update description. + */ + @Generated + private String description; + + /* + * Friendly update name. + */ + @Generated + private String friendlyName; + + /** + * Creates an instance of UpdateInfo class. + * + * @param updateId the updateId value to set. + */ + @Generated + public UpdateInfo(UpdateId updateId) { + this.updateId = updateId; + } + + /** + * Get the updateId property: Update identifier. + * + * @return the updateId value. + */ + @Generated + public UpdateId getUpdateId() { + return this.updateId; + } + + /** + * Get the description property: Update description. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the friendlyName property: Friendly update name. + * + * @return the friendlyName value. + */ + @Generated + public String getFriendlyName() { + return this.friendlyName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("updateId", this.updateId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateInfo if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateInfo. + */ + @Generated + public static UpdateInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateId updateId = null; + String description = null; + String friendlyName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("updateId".equals(fieldName)) { + updateId = UpdateId.fromJson(reader); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("friendlyName".equals(fieldName)) { + friendlyName = reader.getString(); + } else { + reader.skipChildren(); + } + } + UpdateInfo deserializedUpdateInfo = new UpdateInfo(updateId); + deserializedUpdateInfo.description = description; + deserializedUpdateInfo.friendlyName = friendlyName; + + return deserializedUpdateInfo; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateOperation.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateOperation.java new file mode 100644 index 000000000000..7a28d4bfadde --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/UpdateOperation.java @@ -0,0 +1,271 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Operation metadata. + */ +@Immutable +public final class UpdateOperation implements JsonSerializable { + /* + * Operation Id. + */ + @Generated + private final String operationId; + + /* + * Operation status. + */ + @Generated + private final OperationStatus status; + + /* + * The update being imported or deleted. For import, this property will only be + * populated after import manifest is processed successfully. + */ + @Generated + private UpdateInfo update; + + /* + * Location of the imported update when operation is successful. + */ + @Generated + private String resourceLocation; + + /* + * Operation error encountered, if any. + */ + @Generated + private Error error; + + /* + * Operation correlation identity that can used by Microsoft Support for + * troubleshooting. + */ + @Generated + private String traceId; + + /* + * Date and time in UTC when the operation status was last updated. + */ + @Generated + private final OffsetDateTime lastActionDateTime; + + /* + * Date and time in UTC when the operation was created. + */ + @Generated + private final OffsetDateTime createdDateTime; + + /* + * Operation ETag. + */ + @Generated + private String etag; + + /** + * Creates an instance of UpdateOperation class. + * + * @param operationId the operationId value to set. + * @param status the status value to set. + * @param lastActionDateTime the lastActionDateTime value to set. + * @param createdDateTime the createdDateTime value to set. + */ + @Generated + private UpdateOperation(String operationId, OperationStatus status, OffsetDateTime lastActionDateTime, + OffsetDateTime createdDateTime) { + this.operationId = operationId; + this.status = status; + this.lastActionDateTime = lastActionDateTime; + this.createdDateTime = createdDateTime; + } + + /** + * Get the operationId property: Operation Id. + * + * @return the operationId value. + */ + @Generated + public String getOperationId() { + return this.operationId; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + @Generated + public OperationStatus getStatus() { + return this.status; + } + + /** + * Get the update property: The update being imported or deleted. For import, this property will only be + * populated after import manifest is processed successfully. + * + * @return the update value. + */ + @Generated + public UpdateInfo getUpdate() { + return this.update; + } + + /** + * Get the resourceLocation property: Location of the imported update when operation is successful. + * + * @return the resourceLocation value. + */ + @Generated + public String getResourceLocation() { + return this.resourceLocation; + } + + /** + * Get the error property: Operation error encountered, if any. + * + * @return the error value. + */ + @Generated + public Error getError() { + return this.error; + } + + /** + * Get the traceId property: Operation correlation identity that can used by Microsoft Support for + * troubleshooting. + * + * @return the traceId value. + */ + @Generated + public String getTraceId() { + return this.traceId; + } + + /** + * Get the lastActionDateTime property: Date and time in UTC when the operation status was last updated. + * + * @return the lastActionDateTime value. + */ + @Generated + public OffsetDateTime getLastActionDateTime() { + return this.lastActionDateTime; + } + + /** + * Get the createdDateTime property: Date and time in UTC when the operation was created. + * + * @return the createdDateTime value. + */ + @Generated + public OffsetDateTime getCreatedDateTime() { + return this.createdDateTime; + } + + /** + * Get the etag property: Operation ETag. + * + * @return the etag value. + */ + @Generated + public String getEtag() { + return this.etag; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("operationId", this.operationId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("lastActionDateTime", + this.lastActionDateTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastActionDateTime)); + jsonWriter.writeStringField("createdDateTime", + this.createdDateTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdDateTime)); + jsonWriter.writeJsonField("update", this.update); + jsonWriter.writeStringField("resourceLocation", this.resourceLocation); + jsonWriter.writeJsonField("error", this.error); + jsonWriter.writeStringField("traceId", this.traceId); + jsonWriter.writeStringField("etag", this.etag); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateOperation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateOperation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateOperation. + */ + @Generated + public static UpdateOperation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String operationId = null; + OperationStatus status = null; + OffsetDateTime lastActionDateTime = null; + OffsetDateTime createdDateTime = null; + UpdateInfo update = null; + String resourceLocation = null; + Error error = null; + String traceId = null; + String etag = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("operationId".equals(fieldName)) { + operationId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OperationStatus.fromString(reader.getString()); + } else if ("lastActionDateTime".equals(fieldName)) { + lastActionDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdDateTime".equals(fieldName)) { + createdDateTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("update".equals(fieldName)) { + update = UpdateInfo.fromJson(reader); + } else if ("resourceLocation".equals(fieldName)) { + resourceLocation = reader.getString(); + } else if ("error".equals(fieldName)) { + error = Error.fromJson(reader); + } else if ("traceId".equals(fieldName)) { + traceId = reader.getString(); + } else if ("etag".equals(fieldName)) { + etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + UpdateOperation deserializedUpdateOperation + = new UpdateOperation(operationId, status, lastActionDateTime, createdDateTime); + deserializedUpdateOperation.update = update; + deserializedUpdateOperation.resourceLocation = resourceLocation; + deserializedUpdateOperation.error = error; + deserializedUpdateOperation.traceId = traceId; + deserializedUpdateOperation.etag = etag; + + return deserializedUpdateOperation; + }); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/package-info.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/package-info.java new file mode 100644 index 000000000000..8e0a6d8bb0fa --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for 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. + */ +package com.azure.iot.deviceupdate.models; diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/package-info.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/package-info.java index 4e3399623010..1650d77a656f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/package-info.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/package-info.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for 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. + * Package containing the classes for 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. */ package com.azure.iot.deviceupdate; diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/module-info.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/module-info.java index 5cf10a2aa67d..7aa14c676d9b 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/module-info.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/module-info.java @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.iot.deviceupdate { requires transitive com.azure.core; exports com.azure.iot.deviceupdate; + exports com.azure.iot.deviceupdate.models; + + opens com.azure.iot.deviceupdate.models to com.azure.core; } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/resources/META-INF/azure-iot-deviceupdate_metadata.json b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/resources/META-INF/azure-iot-deviceupdate_metadata.json new file mode 100644 index 000000000000..d22b6ab5357b --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/resources/META-INF/azure-iot-deviceupdate_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"DeviceUpdateClient":"2026-06-01"},"crossLanguagePackageId":"DeviceUpdateClient","crossLanguageVersion":"2152dadbc310","crossLanguageDefinitions":{"com.azure.iot.deviceupdate.DeviceManagementAsyncClient":"DeviceUpdateClient","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.beginImportDevices":"DeviceUpdateClient.DeviceManagementOperationGroup.importDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.beginImportDevicesWithModel":"DeviceUpdateClient.DeviceManagementOperationGroup.importDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.createOrUpdateDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.createOrUpdateDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeployment":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeploymentForDeviceClassSubgroup":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeploymentForDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeploymentWithResponse":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClassWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteGroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getBestUpdatesForDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getBestUpdatesForDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentForDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentForDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDevice":"DeviceUpdateClient.DeviceManagementOperationGroup.getDevice","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupDeploymentStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupDeploymentStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupUpdateCompliance":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupUpdateComplianceWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceModule":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceModuleWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDevice","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getGroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollection":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollectionDetailedStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollectionDetailedStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollectionWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getOperationStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getOperationStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateCompliance":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateComplianceForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateComplianceForGroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateComplianceWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listBestUpdatesForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeploymentsForDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeploymentsForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeviceClassSubgroupsForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeviceClasses":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeviceStatesForDeviceClassSubgroupDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDevices":"DeviceUpdateClient.DeviceManagementOperationGroup.listDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listGroups":"DeviceUpdateClient.DeviceManagementOperationGroup.listGroups","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listHealthOfDevices":"DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listInstallableUpdatesForDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listLogCollections":"DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listOperationStatuses":"DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.retryDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.retryDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.startLogCollection":"DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.startLogCollectionWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.stopDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.stopDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.updateDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.updateDeviceClassWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient":"DeviceUpdateClient","com.azure.iot.deviceupdate.DeviceManagementClient.beginImportDevices":"DeviceUpdateClient.DeviceManagementOperationGroup.importDevices","com.azure.iot.deviceupdate.DeviceManagementClient.beginImportDevicesWithModel":"DeviceUpdateClient.DeviceManagementOperationGroup.importDevices","com.azure.iot.deviceupdate.DeviceManagementClient.createOrUpdateDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.createOrUpdateDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeployment":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroup":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeploymentWithResponse":"DeviceUpdateClient.DeploymentManagementOperationGroup.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClassWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.deleteGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteGroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentForDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.getDevice":"DeviceUpdateClient.DeviceManagementOperationGroup.getDevice","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupUpdateCompliance":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupUpdateComplianceWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceModule":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceModuleWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getDevice","com.azure.iot.deviceupdate.DeviceManagementClient.getGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getGroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollection":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollectionDetailedStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollectionDetailedStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollectionWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.getOperationStatus":"DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getOperationStatusWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateCompliance":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateComplianceForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateComplianceForGroupWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateComplianceWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.listBestUpdatesForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listBestUpdatesForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeploymentsForDeviceClassSubgroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeploymentsForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeploymentsForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeviceClassSubgroupsForGroup":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClassSubgroupsForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeviceClasses":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceClasses","com.azure.iot.deviceupdate.DeviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.listDeviceStatesForDeviceClassSubgroupDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.listDevices":"DeviceUpdateClient.DeviceManagementOperationGroup.listDevices","com.azure.iot.deviceupdate.DeviceManagementClient.listGroups":"DeviceUpdateClient.DeviceManagementOperationGroup.listGroups","com.azure.iot.deviceupdate.DeviceManagementClient.listHealthOfDevices":"DeviceUpdateClient.DeviceManagementOperationGroup.listHealthOfDevices","com.azure.iot.deviceupdate.DeviceManagementClient.listInstallableUpdatesForDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.listInstallableUpdatesForDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.listLogCollections":"DeviceUpdateClient.DeviceManagementOperationGroup.listLogCollections","com.azure.iot.deviceupdate.DeviceManagementClient.listOperationStatuses":"DeviceUpdateClient.DeviceManagementOperationGroup.listOperationStatuses","com.azure.iot.deviceupdate.DeviceManagementClient.retryDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.retryDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.startLogCollection":"DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.startLogCollectionWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.stopDeployment":"DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.stopDeploymentWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.updateDeviceClass":"DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.updateDeviceClassWithResponse":"DeviceUpdateClient.DeviceManagementOperationGroup.updateDeviceClass","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient":"DeviceUpdateClient","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginDeleteUpdate":"DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginDeleteUpdateWithModel":"DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginImportUpdate":"DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginImportUpdateWithModel":"DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getFile":"DeviceUpdateClient.DeviceUpdateOperationGroup.getFile","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getFileWithResponse":"DeviceUpdateClient.DeviceUpdateOperationGroup.getFile","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getOperationStatus":"DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getOperationStatusWithResponse":"DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getUpdate":"DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getUpdateWithResponse":"DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listFiles":"DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listNames":"DeviceUpdateClient.DeviceUpdateOperationGroup.listNames","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listOperationStatuses":"DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listProviders":"DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listUpdates":"DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listVersions":"DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions","com.azure.iot.deviceupdate.DeviceUpdateClient":"DeviceUpdateClient","com.azure.iot.deviceupdate.DeviceUpdateClient.beginDeleteUpdate":"DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.beginDeleteUpdateWithModel":"DeviceUpdateClient.DeviceUpdateOperationGroup.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.beginImportUpdate":"DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.beginImportUpdateWithModel":"DeviceUpdateClient.DeviceUpdateOperationGroup.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.getFile":"DeviceUpdateClient.DeviceUpdateOperationGroup.getFile","com.azure.iot.deviceupdate.DeviceUpdateClient.getFileWithResponse":"DeviceUpdateClient.DeviceUpdateOperationGroup.getFile","com.azure.iot.deviceupdate.DeviceUpdateClient.getOperationStatus":"DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateClient.getOperationStatusWithResponse":"DeviceUpdateClient.DeviceUpdateOperationGroup.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateClient.getUpdate":"DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.getUpdateWithResponse":"DeviceUpdateClient.DeviceUpdateOperationGroup.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.listFiles":"DeviceUpdateClient.DeviceUpdateOperationGroup.listFiles","com.azure.iot.deviceupdate.DeviceUpdateClient.listNames":"DeviceUpdateClient.DeviceUpdateOperationGroup.listNames","com.azure.iot.deviceupdate.DeviceUpdateClient.listOperationStatuses":"DeviceUpdateClient.DeviceUpdateOperationGroup.listOperationStatuses","com.azure.iot.deviceupdate.DeviceUpdateClient.listProviders":"DeviceUpdateClient.DeviceUpdateOperationGroup.listProviders","com.azure.iot.deviceupdate.DeviceUpdateClient.listUpdates":"DeviceUpdateClient.DeviceUpdateOperationGroup.listUpdates","com.azure.iot.deviceupdate.DeviceUpdateClient.listVersions":"DeviceUpdateClient.DeviceUpdateOperationGroup.listVersions","com.azure.iot.deviceupdate.DeviceUpdateClientBuilder":"DeviceUpdateClient","com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy":"DeviceUpdateClient.CloudInitiatedRollbackPolicy","com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure":"DeviceUpdateClient.CloudInitiatedRollbackPolicyFailure","com.azure.iot.deviceupdate.models.Compatibility":"DeviceUpdateClient.Compatibility","com.azure.iot.deviceupdate.models.ContractModel":"DeviceUpdateClient.ContractModel","com.azure.iot.deviceupdate.models.Deployment":"DeviceUpdateClient.Deployment","com.azure.iot.deviceupdate.models.DeploymentDeviceState":"DeviceUpdateClient.DeploymentDeviceState","com.azure.iot.deviceupdate.models.DeploymentState":"DeviceUpdateClient.DeploymentState","com.azure.iot.deviceupdate.models.DeploymentStatus":"DeviceUpdateClient.DeploymentStatus","com.azure.iot.deviceupdate.models.Device":"DeviceUpdateClient.Device","com.azure.iot.deviceupdate.models.DeviceClass":"DeviceUpdateClient.DeviceClass","com.azure.iot.deviceupdate.models.DeviceClassProperties":"DeviceUpdateClient.DeviceClassProperties","com.azure.iot.deviceupdate.models.DeviceClassSubgroup":"DeviceUpdateClient.DeviceClassSubgroup","com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState":"DeviceUpdateClient.DeviceClassSubgroupDeploymentState","com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus":"DeviceUpdateClient.DeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices":"DeviceUpdateClient.DeviceClassSubgroupUpdatableDevices","com.azure.iot.deviceupdate.models.DeviceDeploymentState":"DeviceUpdateClient.DeviceDeploymentState","com.azure.iot.deviceupdate.models.DeviceHealth":"DeviceUpdateClient.DeviceHealth","com.azure.iot.deviceupdate.models.DeviceHealthState":"DeviceUpdateClient.DeviceHealthState","com.azure.iot.deviceupdate.models.DeviceOperation":"DeviceUpdateClient.DeviceOperation","com.azure.iot.deviceupdate.models.DeviceUpdateAgentId":"DeviceUpdateClient.DeviceUpdateAgentId","com.azure.iot.deviceupdate.models.DownloadSecurity":"DeviceUpdateClient.DownloadSecurity","com.azure.iot.deviceupdate.models.Error":"DeviceUpdateClient.Error","com.azure.iot.deviceupdate.models.FileImportMetadata":"DeviceUpdateClient.FileImportMetadata","com.azure.iot.deviceupdate.models.Group":"DeviceUpdateClient.Group","com.azure.iot.deviceupdate.models.GroupType":"DeviceUpdateClient.GroupType","com.azure.iot.deviceupdate.models.HealthCheck":"DeviceUpdateClient.HealthCheck","com.azure.iot.deviceupdate.models.HealthCheckResult":"DeviceUpdateClient.HealthCheckResult","com.azure.iot.deviceupdate.models.ImportManifestMetadata":"DeviceUpdateClient.ImportManifestMetadata","com.azure.iot.deviceupdate.models.ImportType":"DeviceUpdateClient.ImportType","com.azure.iot.deviceupdate.models.ImportUpdateInputItem":"DeviceUpdateClient.ImportUpdateInputItem","com.azure.iot.deviceupdate.models.InnerError":"DeviceUpdateClient.InnerError","com.azure.iot.deviceupdate.models.InstallResult":"DeviceUpdateClient.InstallResult","com.azure.iot.deviceupdate.models.Instructions":"DeviceUpdateClient.Instructions","com.azure.iot.deviceupdate.models.LogCollection":"DeviceUpdateClient.LogCollection","com.azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus":"DeviceUpdateClient.LogCollectionOperationDetailedStatus","com.azure.iot.deviceupdate.models.LogCollectionOperationDeviceStatus":"DeviceUpdateClient.LogCollectionOperationDeviceStatus","com.azure.iot.deviceupdate.models.OperationStatus":"DeviceUpdateClient.OperationStatus","com.azure.iot.deviceupdate.models.PatchBody":"DeviceUpdateClient.PatchBody","com.azure.iot.deviceupdate.models.Step":"DeviceUpdateClient.Step","com.azure.iot.deviceupdate.models.StepResult":"DeviceUpdateClient.StepResult","com.azure.iot.deviceupdate.models.StepType":"DeviceUpdateClient.StepType","com.azure.iot.deviceupdate.models.Update":"DeviceUpdateClient.Update","com.azure.iot.deviceupdate.models.UpdateCompliance":"DeviceUpdateClient.UpdateCompliance","com.azure.iot.deviceupdate.models.UpdateFile":"DeviceUpdateClient.UpdateFile","com.azure.iot.deviceupdate.models.UpdateFileBase":"DeviceUpdateClient.UpdateFileBase","com.azure.iot.deviceupdate.models.UpdateFileDownloadHandler":"DeviceUpdateClient.UpdateFileDownloadHandler","com.azure.iot.deviceupdate.models.UpdateId":"DeviceUpdateClient.UpdateId","com.azure.iot.deviceupdate.models.UpdateInfo":"DeviceUpdateClient.UpdateInfo","com.azure.iot.deviceupdate.models.UpdateOperation":"DeviceUpdateClient.UpdateOperation"},"generatedFiles":["src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java","src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java","src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java","src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java","src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java","src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java","src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java","src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java","src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java","src/main/java/com/azure/iot/deviceupdate/implementation/JsonMergePatchHelper.java","src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java","src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicy.java","src/main/java/com/azure/iot/deviceupdate/models/CloudInitiatedRollbackPolicyFailure.java","src/main/java/com/azure/iot/deviceupdate/models/Compatibility.java","src/main/java/com/azure/iot/deviceupdate/models/ContractModel.java","src/main/java/com/azure/iot/deviceupdate/models/Deployment.java","src/main/java/com/azure/iot/deviceupdate/models/DeploymentDeviceState.java","src/main/java/com/azure/iot/deviceupdate/models/DeploymentState.java","src/main/java/com/azure/iot/deviceupdate/models/DeploymentStatus.java","src/main/java/com/azure/iot/deviceupdate/models/Device.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceClass.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceClassProperties.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroup.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentState.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupDeploymentStatus.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceClassSubgroupUpdatableDevices.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceDeploymentState.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceHealth.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceHealthState.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceOperation.java","src/main/java/com/azure/iot/deviceupdate/models/DeviceUpdateAgentId.java","src/main/java/com/azure/iot/deviceupdate/models/DownloadSecurity.java","src/main/java/com/azure/iot/deviceupdate/models/Error.java","src/main/java/com/azure/iot/deviceupdate/models/FileImportMetadata.java","src/main/java/com/azure/iot/deviceupdate/models/Group.java","src/main/java/com/azure/iot/deviceupdate/models/GroupType.java","src/main/java/com/azure/iot/deviceupdate/models/HealthCheck.java","src/main/java/com/azure/iot/deviceupdate/models/HealthCheckResult.java","src/main/java/com/azure/iot/deviceupdate/models/ImportManifestMetadata.java","src/main/java/com/azure/iot/deviceupdate/models/ImportType.java","src/main/java/com/azure/iot/deviceupdate/models/ImportUpdateInputItem.java","src/main/java/com/azure/iot/deviceupdate/models/InnerError.java","src/main/java/com/azure/iot/deviceupdate/models/InstallResult.java","src/main/java/com/azure/iot/deviceupdate/models/Instructions.java","src/main/java/com/azure/iot/deviceupdate/models/LogCollection.java","src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDetailedStatus.java","src/main/java/com/azure/iot/deviceupdate/models/LogCollectionOperationDeviceStatus.java","src/main/java/com/azure/iot/deviceupdate/models/OperationStatus.java","src/main/java/com/azure/iot/deviceupdate/models/PatchBody.java","src/main/java/com/azure/iot/deviceupdate/models/Step.java","src/main/java/com/azure/iot/deviceupdate/models/StepResult.java","src/main/java/com/azure/iot/deviceupdate/models/StepType.java","src/main/java/com/azure/iot/deviceupdate/models/Update.java","src/main/java/com/azure/iot/deviceupdate/models/UpdateCompliance.java","src/main/java/com/azure/iot/deviceupdate/models/UpdateFile.java","src/main/java/com/azure/iot/deviceupdate/models/UpdateFileBase.java","src/main/java/com/azure/iot/deviceupdate/models/UpdateFileDownloadHandler.java","src/main/java/com/azure/iot/deviceupdate/models/UpdateId.java","src/main/java/com/azure/iot/deviceupdate/models/UpdateInfo.java","src/main/java/com/azure/iot/deviceupdate/models/UpdateOperation.java","src/main/java/com/azure/iot/deviceupdate/models/package-info.java","src/main/java/com/azure/iot/deviceupdate/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/DeleteUpdateSample.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/DeleteUpdateSample.java index bc963205087b..5c26102e759f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/DeleteUpdateSample.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/DeleteUpdateSample.java @@ -5,6 +5,7 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; import com.azure.core.util.polling.SyncPoller; @@ -17,7 +18,7 @@ public static void main(String[] args) { .instanceId(Configuration.getGlobalConfiguration().get("AZURE_INSTANCE_ID")) .credential(new DefaultAzureCredentialBuilder().build()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + .buildDeviceUpdateClient(); try { String updateProvider = Configuration.getGlobalConfiguration().get("DEVICEUPDATE_UPDATE_PROVIDER"); @@ -25,7 +26,8 @@ public static void main(String[] args) { String updateVersion = Configuration.getGlobalConfiguration().get("DEVICEUPDATE_UPDATE_VERSION"); // BEGIN: com.azure.iot.deviceupdate.DeviceUpdateClient.DeleteUpdate - SyncPoller response = client.beginDeleteUpdate(updateProvider, updateName, updateVersion, null); + SyncPoller response + = client.beginDeleteUpdate(updateProvider, updateName, updateVersion, (RequestOptions) null); response.waitForCompletion(); // END: com.azure.iot.deviceupdate.DeviceUpdateClient.DeleteUpdate diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetDeviceSample.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetDeviceSample.java index e70eb3d8f876..c5e48f0975cb 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetDeviceSample.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetDeviceSample.java @@ -6,6 +6,7 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -28,7 +29,7 @@ public static void main(String[] args) { try { System.out.println("Devices:"); // BEGIN: com.azure.iot.deviceupdate.DeviceManagementClient.EnumerateDevices - PagedIterable devices = client.listDevices(null); + PagedIterable devices = client.listDevices((RequestOptions) null); for (BinaryData d: devices) { System.out.println(new ObjectMapper().readTree(d.toBytes()).get("deviceId").asText()); } @@ -36,7 +37,7 @@ public static void main(String[] args) { System.out.println("\nDevice groups:"); // BEGIN: com.azure.iot.deviceupdate.DeviceManagementClient.EnumerateGroups - PagedIterable groups = client.listGroups(null); + PagedIterable groups = client.listGroups((RequestOptions) null); for (BinaryData g: groups) { System.out.println(new ObjectMapper().readTree(g.toBytes()).get("groupId").asText()); } @@ -44,7 +45,7 @@ public static void main(String[] args) { System.out.println("\nDevice classes:"); // BEGIN: com.azure.iot.deviceupdate.DeviceManagementClient.EnumerateDeviceClasses - PagedIterable deviceClasses = client.listDeviceClasses(null); + PagedIterable deviceClasses = client.listDeviceClasses((RequestOptions) null); for (BinaryData dc: deviceClasses) { System.out.println(new ObjectMapper().readTree(dc.toBytes()).get("deviceClassId").asText()); } @@ -53,7 +54,7 @@ public static void main(String[] args) { String groupId = Configuration.getGlobalConfiguration().get("DEVICEUPDATE_DEVICE_GROUP"); System.out.println("\nBest updates:"); // BEGIN: com.azure.iot.deviceupdate.DeviceManagementClient.GetBestUpdates - PagedIterable bestUpdates = client.listBestUpdatesForGroup(groupId, null); + PagedIterable bestUpdates = client.listBestUpdatesForGroup(groupId, (RequestOptions) null); ObjectMapper updateMapper = new ObjectMapper(); for (BinaryData bu: bestUpdates) { JsonNode json = updateMapper.readTree(bu.toBytes()); diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateNotFoundSample.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateNotFoundSample.java index 1447519efaa1..7d83948f5475 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateNotFoundSample.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateNotFoundSample.java @@ -17,7 +17,7 @@ public static void main(String[] args) { .instanceId(Configuration.getGlobalConfiguration().get("AZURE_INSTANCE_ID")) .credential(new DefaultAzureCredentialBuilder().build()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + .buildDeviceUpdateClient(); // BEGIN: com.azure.iot.deviceupdate.DeviceUpdateClient.notfound try { diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateSample.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateSample.java index a218cfeb9651..05b60a6739df 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateSample.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/GetUpdateSample.java @@ -25,7 +25,7 @@ public static void main(String[] args) { .instanceId(Configuration.getGlobalConfiguration().get("AZURE_INSTANCE_ID")) .credential(new DefaultAzureCredentialBuilder().build()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + .buildDeviceUpdateClient(); // END: com.azure.iot.deviceupdate.DeviceUpdateClient.instantiate try { diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ImportUpdateSample.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ImportUpdateSample.java index bd8beaf9b7c4..854f17c40582 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ImportUpdateSample.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ImportUpdateSample.java @@ -25,7 +25,7 @@ public static void main(String[] args) throws IOException { .instanceId(Configuration.getGlobalConfiguration().get("AZURE_INSTANCE_ID")) .credential(new DefaultAzureCredentialBuilder().build()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + .buildDeviceUpdateClient(); try { String payloadFile = Configuration.getGlobalConfiguration().get("DEVICEUPDATE_PAYLOAD_FILE"); diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ListUpdatesSample.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ListUpdatesSample.java index ada098c58af1..f53c217a88e6 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ListUpdatesSample.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/ListUpdatesSample.java @@ -6,6 +6,7 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.util.BinaryData; import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; @@ -17,12 +18,12 @@ public static void main(String[] args) { .instanceId(Configuration.getGlobalConfiguration().get("AZURE_INSTANCE_ID")) .credential(new DefaultAzureCredentialBuilder().build()) .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + .buildDeviceUpdateClient(); try { System.out.println("Enumerate providers:"); // BEGIN: com.azure.iot.deviceupdate.DeviceUpdateClient.EnumerateProviders - PagedIterable providers = client.listProviders(null); + PagedIterable providers = client.listProviders((RequestOptions) null); for (BinaryData p: providers) { System.out.println(p); } @@ -32,7 +33,7 @@ public static void main(String[] args) { System.out.println("\nEnumerate '" + updateProvider + "' names:"); // BEGIN: com.azure.iot.deviceupdate.DeviceUpdateClient.EnumerateNames System.out.println("Providers:"); - PagedIterable names = client.listNames(updateProvider, null); + PagedIterable names = client.listNames(updateProvider, (RequestOptions) null); for (BinaryData n: names) { System.out.println(n); } @@ -41,7 +42,7 @@ public static void main(String[] args) { String updateName = Configuration.getGlobalConfiguration().get("DEVICEUPDATE_UPDATE_NAME"); System.out.println("\nEnumerate provider '" + updateProvider + "' and name '" + updateName + "' versions:"); // BEGIN: com.azure.iot.deviceupdate.DeviceUpdateClient.EnumerateVersions - PagedIterable versions = client.listVersions(updateProvider, updateName, null); + PagedIterable versions = client.listVersions(updateProvider, updateName, (RequestOptions) null); for (BinaryData v: versions) { System.out.println(v); } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java deleted file mode 100644 index 5ce05025e40a..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.iot.deviceupdate.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -public class DeviceManagementCancelOrRetryDeployment { - public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementstopdeployment.devicemanagementcancelorretrydeployment - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.stopDeploymentWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementstopdeployment.devicemanagementcancelorretrydeployment - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java index 92d08cba9ab2..fb3e4d0fff67 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java @@ -1,32 +1,35 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.DownloadSecurity; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import java.time.OffsetDateTime; public class DeviceManagementCreateOrUpdateDeployment { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementcreateorupdatedeployment.devicemanagementcreateorupdatedeployment - BinaryData deployment = - BinaryData.fromString( - "{\"deploymentId\":\"deploymentId\",\"groupId\":\"TestGroup\",\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.3\"}}},\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.createOrUpdateDeploymentWithResponse( - "TestGroup", "deploymentId", deployment, requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementcreateorupdatedeployment.devicemanagementcreateorupdatedeployment + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-create-or-update-deployment.device-management-create-or-update-deployment + Deployment response = deviceManagementClient.createOrUpdateDeployment("TestGroup", "deploymentId", + new Deployment("deploymentId", OffsetDateTime.parse("2020-04-22T05:12:12-07:00"), + new UpdateInfo(new UpdateId("provider", "name", "1.2.3.4")), "TestGroup") + .setRollbackPolicy( + new CloudInitiatedRollbackPolicy(new UpdateInfo(new UpdateId("provider", "name", "1.2.3.3")), + new CloudInitiatedRollbackPolicyFailure(50, 100))) + .setDownloadSecurity(DownloadSecurity.HTTPS)); + // END:com.azure.iot.deviceupdate.generated.device-management-create-or-update-deployment.device-management-create-or-update-deployment } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java index 5b4c876bf834..d645919fd566 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java @@ -1,27 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceManagementDeleteDeployment { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeployment.devicemanagementdeletedeployment - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.deleteDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeployment.devicemanagementdeletedeployment + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-delete-deployment.device-management-delete-deployment + deviceManagementClient.deleteDeployment("TestGroup", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-delete-deployment.device-management-delete-deployment } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.java index e812e734478b..68250f31a481 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.java @@ -1,28 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceManagementDeleteDeploymentForDeviceClassSubgroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeploymentfordeviceclasssubgroup.devicemanagementdeletedeploymentfordeviceclasssubgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.deleteDeploymentForDeviceClassSubgroupWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeploymentfordeviceclasssubgroup.devicemanagementdeletedeploymentfordeviceclasssubgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-delete-deployment-for-device-class-subgroup.device-management-delete-deployment-for-device-class-subgroup + deviceManagementClient.deleteDeploymentForDeviceClassSubgroup("TestGroup", "deviceClassId", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-delete-deployment-for-device-class-subgroup.device-management-delete-deployment-for-device-class-subgroup } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java index c3e43adccc0e..9be9fd2d202e 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java @@ -1,26 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceManagementDeleteDeviceClass { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeviceclass.devicemanagementdeletedeviceclass - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteDeviceClassWithResponse("deviceClass1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeviceclass.devicemanagementdeletedeviceclass + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-delete-device-class.device-management-delete-device-class + deviceManagementClient.deleteDeviceClass("deviceClass1"); + // END:com.azure.iot.deviceupdate.generated.device-management-delete-device-class.device-management-delete-device-class } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java index a261f32ac5e5..fd12ca3cba1a 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java @@ -1,27 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceManagementDeleteDeviceClassSubgroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeviceclasssubgroup.devicemanagementdeletedeviceclasssubgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.deleteDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementdeletedeviceclasssubgroup.devicemanagementdeletedeviceclasssubgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-delete-device-class-subgroup.device-management-delete-device-class-subgroup + deviceManagementClient.deleteDeviceClassSubgroup("group1", "deviceClassId"); + // END:com.azure.iot.deviceupdate.generated.device-management-delete-device-class-subgroup.device-management-delete-device-class-subgroup } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java index e171640401e4..3068ea805e41 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java @@ -1,26 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceManagementDeleteGroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementdeletegroup.devicemanagementdeletegroup - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteGroupWithResponse("group1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementdeletegroup.devicemanagementdeletegroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-delete-group.device-management-delete-group + deviceManagementClient.deleteGroup("group1"); + // END:com.azure.iot.deviceupdate.generated.device-management-delete-group.device-management-delete-group } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetBestUpdatesForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetBestUpdatesForDeviceClassSubgroup.java new file mode 100644 index 000000000000..557c3b1ffc9e --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetBestUpdatesForDeviceClassSubgroup.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.iot.deviceupdate.DeviceManagementClient; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices; + +public class DeviceManagementGetBestUpdatesForDeviceClassSubgroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-best-updates-for-device-class-subgroup.device-management-get-best-updates-for-device-class-subgroup + DeviceClassSubgroupUpdatableDevices response + = deviceManagementClient.getBestUpdatesForDeviceClassSubgroup("group1", "deviceClassId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-best-updates-for-device-class-subgroup.device-management-get-best-updates-for-device-class-subgroup + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.java index 55eb6983a6fd..16e0972602f0 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Deployment; public class DeviceManagementGetDeployment { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdeployment.devicemanagementgetdeployment - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdeployment.devicemanagementgetdeployment + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-deployment.device-management-get-deployment + Deployment response = deviceManagementClient.getDeployment("TestGroup", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-deployment.device-management-get-deployment } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java index 22630ab1f1fb..7dd40bd997fb 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java @@ -1,29 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Deployment; public class DeviceManagementGetDeploymentForDeviceClassSubgroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdeploymentfordeviceclasssubgroup.devicemanagementgetdeploymentfordeviceclasssubgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdeploymentfordeviceclasssubgroup.devicemanagementgetdeploymentfordeviceclasssubgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-deployment-for-device-class-subgroup.device-management-get-deployment-for-device-class-subgroup + Deployment response + = deviceManagementClient.getDeploymentForDeviceClassSubgroup("TestGroup", "deviceClassId", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-deployment-for-device-class-subgroup.device-management-get-deployment-for-device-class-subgroup } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java index 40daed7a2de4..2e3a80bb0609 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeploymentStatus; public class DeviceManagementGetDeploymentStatus { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdeploymentstatus.devicemanagementgetdeploymentstatus - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getDeploymentStatusWithResponse("TestGroup", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdeploymentstatus.devicemanagementgetdeploymentstatus + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-deployment-status.device-management-get-deployment-status + DeploymentStatus response = deviceManagementClient.getDeploymentStatus("TestGroup", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-deployment-status.device-management-get-deployment-status } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java index f905063193e5..4c5d01f74217 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java @@ -1,27 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Device; public class DeviceManagementGetDevice { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdevice.devicemanagementgetdevice - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getDeviceWithResponse("deviceId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdevice.devicemanagementgetdevice + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-device.device-management-get-device + Device response = deviceManagementClient.getDevice("deviceId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-device.device-management-get-device } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.java index d86114d8742e..8f2177164350 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClass; public class DeviceManagementGetDeviceClass { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclass.devicemanagementgetdeviceclass - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getDeviceClassWithResponse("deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclass.devicemanagementgetdeviceclass + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-device-class.device-management-get-device-class + DeviceClass response = deviceManagementClient.getDeviceClass("deviceClassId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-device-class.device-management-get-device-class } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroup.java new file mode 100644 index 000000000000..614ace1f4593 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroup.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.iot.deviceupdate.DeviceManagementClient; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroup; + +public class DeviceManagementGetDeviceClassSubgroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-device-class-subgroup.device-management-get-device-class-subgroup + DeviceClassSubgroup response = deviceManagementClient.getDeviceClassSubgroup("group1", "deviceClassId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-device-class-subgroup.device-management-get-device-class-subgroup + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java index 4208038af606..7cf935b0e74f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java @@ -1,29 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus; public class DeviceManagementGetDeviceClassSubgroupDeploymentStatus { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupdeploymentstatus.devicemanagementgetdeviceclasssubgroupdeploymentstatus - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupdeploymentstatus.devicemanagementgetdeviceclasssubgroupdeploymentstatus + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-device-class-subgroup-deployment-status.device-management-get-device-class-subgroup-deployment-status + DeviceClassSubgroupDeploymentStatus response = deviceManagementClient + .getDeviceClassSubgroupDeploymentStatus("TestGroup", "deviceClassId", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-device-class-subgroup-deployment-status.device-management-get-device-class-subgroup-deployment-status } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java index 1d4d3897da3d..d13ee5dee515 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java @@ -1,29 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateCompliance; public class DeviceManagementGetDeviceClassSubgroupUpdateCompliance { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupupdatecompliance.devicemanagementgetdeviceclasssubgroupupdatecompliance - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getDeviceClassSubgroupUpdateComplianceWithResponse( - "group1", "deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupupdatecompliance.devicemanagementgetdeviceclasssubgroupupdatecompliance + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-device-class-subgroup-update-compliance.device-management-get-device-class-subgroup-update-compliance + UpdateCompliance response + = deviceManagementClient.getDeviceClassSubgroupUpdateCompliance("group1", "deviceClassId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-device-class-subgroup-update-compliance.device-management-get-device-class-subgroup-update-compliance } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceModule.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceModule.java new file mode 100644 index 000000000000..0e980ee7820d --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceModule.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.iot.deviceupdate.DeviceManagementClient; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Device; + +public class DeviceManagementGetDeviceModule { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-device-module.device-management-get-device-module + Device response = deviceManagementClient.getDeviceModule("deviceId", "moduleId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-device-module.device-management-get-device-module + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java index 2e0f3f549926..6cf369b9f734 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java @@ -1,27 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Group; public class DeviceManagementGetGroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetgroup.devicemanagementgetgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getGroupWithResponse("group1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetgroup.devicemanagementgetgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-group.device-management-get-group + Group response = deviceManagementClient.getGroup("group1"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-group.device-management-get-group } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java deleted file mode 100644 index 4cfe9c00dbe2..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.iot.deviceupdate.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -public class DeviceManagementGetGroupUpdateCompliance { - public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclasssubgroup.devicemanagementgetgroupupdatecompliance - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetdeviceclasssubgroup.devicemanagementgetgroupupdatecompliance - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.java index 002aba4abbec..3166d0db9389 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.LogCollection; public class DeviceManagementGetLogCollection { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetlogcollection.devicemanagementgetlogcollection - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getLogCollectionWithResponse("LogCollectionId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetlogcollection.devicemanagementgetlogcollection + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-log-collection.device-management-get-log-collection + LogCollection response = deviceManagementClient.getLogCollection("LogCollectionId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-log-collection.device-management-get-log-collection } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.java index bb40d189ba1d..24c598540c6a 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.java @@ -1,28 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus; public class DeviceManagementGetLogCollectionDetailedStatus { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetlogcollectiondetailedstatus.devicemanagementgetlogcollectiondetailedstatus - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getLogCollectionDetailedStatusWithResponse("LogCollectionId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetlogcollectiondetailedstatus.devicemanagementgetlogcollectiondetailedstatus + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-log-collection-detailed-status.device-management-get-log-collection-detailed-status + LogCollectionOperationDetailedStatus response + = deviceManagementClient.getLogCollectionDetailedStatus("LogCollectionId"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-log-collection-detailed-status.device-management-get-log-collection-detailed-status } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.java index 1a18816230c0..ea2e8aa3a997 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.java @@ -1,29 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceOperation; public class DeviceManagementGetOperationStatus { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetoperationstatus.devicemanagementgetoperationstatus - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getOperationStatusWithResponse( - "e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetoperationstatus.devicemanagementgetoperationstatus + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-operation-status.device-management-get-operation-status + DeviceOperation response + = deviceManagementClient.getOperationStatus("e4491c54-916f-443d-9094-bcca546ace2f", null); + // END:com.azure.iot.deviceupdate.generated.device-management-get-operation-status.device-management-get-operation-status } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java index 35f9ed38b62c..338bc1a28e0b 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java @@ -1,27 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateCompliance; public class DeviceManagementGetUpdateCompliance { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetupdatecompliance.devicemanagementgetupdatecompliance - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getUpdateComplianceWithResponse(requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetupdatecompliance.devicemanagementgetupdatecompliance + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-update-compliance.device-management-get-update-compliance + UpdateCompliance response = deviceManagementClient.getUpdateCompliance(); + // END:com.azure.iot.deviceupdate.generated.device-management-get-update-compliance.device-management-get-update-compliance } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.java index 60f237a29df9..04259e2ca52e 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateCompliance; public class DeviceManagementGetUpdateComplianceForGroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetupdatecomplianceforgroup.devicemanagementgetupdatecomplianceforgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getUpdateComplianceForGroupWithResponse("group1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetupdatecomplianceforgroup.devicemanagementgetupdatecomplianceforgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-get-update-compliance-for-group.device-management-get-update-compliance-for-group + UpdateCompliance response = deviceManagementClient.getUpdateComplianceForGroup("group1"); + // END:com.azure.iot.deviceupdate.generated.device-management-get-update-compliance-for-group.device-management-get-update-compliance-for-group } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.java index 58ee6f595a0c..467495e7d946 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.java @@ -1,29 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.core.util.polling.SyncPoller; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceOperation; +import com.azure.iot.deviceupdate.models.ImportType; public class DeviceManagementImportDevices { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementimportdevices.devicemanagementimportdevices - BinaryData importType = BinaryData.fromString("\"All\""); - RequestOptions requestOptions = new RequestOptions(); - SyncPoller response = - deviceManagementClient.beginImportDevices(importType, requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementimportdevices.devicemanagementimportdevices + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-import-devices.device-management-import-devices + SyncPoller response = deviceManagementClient.beginImportDevices(ImportType.ALL); + // END:com.azure.iot.deviceupdate.generated.device-management-import-devices.device-management-import-devices } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java deleted file mode 100644 index 878466498eb9..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.iot.deviceupdate.generated; - -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; -import com.azure.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -public class DeviceManagementListBestUpdatesForDeviceClassSubgroup { - public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementgetbestupdatesfordeviceclasssubgroup.devicemanagementlistbestupdatesfordeviceclasssubgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.getBestUpdatesForDeviceClassSubgroupWithResponse( - "group1", "deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementgetbestupdatesfordeviceclasssubgroup.devicemanagementlistbestupdatesfordeviceclasssubgroup - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java index 34979b073493..881c6ac26ace 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java @@ -1,27 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices; public class DeviceManagementListBestUpdatesForGroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistbestupdatesforgroup.devicemanagementlistbestupdatesforgroup - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listBestUpdatesForGroup("group1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistbestupdatesforgroup.devicemanagementlistbestupdatesforgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-best-updates-for-group.device-management-list-best-updates-for-group + PagedIterable response + = deviceManagementClient.listBestUpdatesForGroup("group1"); + // END:com.azure.iot.deviceupdate.generated.device-management-list-best-updates-for-group.device-management-list-best-updates-for-group } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java index 161aa0c6ece5..efd958e3d0e2 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java @@ -1,29 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Deployment; public class DeviceManagementListDeploymentsForDeviceClassSubgroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistdeploymentsfordeviceclasssubgroup.devicemanagementlistdeploymentsfordeviceclasssubgroup - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = - deviceManagementClient.listDeploymentsForDeviceClassSubgroup( - "TestGroup", "deviceClassId1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistdeploymentsfordeviceclasssubgroup.devicemanagementlistdeploymentsfordeviceclasssubgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-deployments-for-device-class-subgroup.device-management-list-deployments-for-device-class-subgroup + PagedIterable response + = deviceManagementClient.listDeploymentsForDeviceClassSubgroup("TestGroup", "deviceClassId1"); + // END:com.azure.iot.deviceupdate.generated.device-management-list-deployments-for-device-class-subgroup.device-management-list-deployments-for-device-class-subgroup } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java index 95d524220eeb..1a88675edd36 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java @@ -1,28 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Deployment; public class DeviceManagementListDeploymentsForGroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistdeploymentsforgroup.devicemanagementlistdeploymentsforgroup - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = - deviceManagementClient.listDeploymentsForGroup("TestGroup", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistdeploymentsforgroup.devicemanagementlistdeploymentsforgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-deployments-for-group.device-management-list-deployments-for-group + PagedIterable response = deviceManagementClient.listDeploymentsForGroup("TestGroup"); + // END:com.azure.iot.deviceupdate.generated.device-management-list-deployments-for-group.device-management-list-deployments-for-group } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java index 7b9dccf787f7..fd10f79c60a2 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java @@ -1,28 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroup; public class DeviceManagementListDeviceClassSubgroupsForGroup { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistdeviceclasssubgroupsforgroup.devicemanagementlistdeviceclasssubgroupsforgroup - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = - deviceManagementClient.listDeviceClassSubgroupsForGroup("group1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistdeviceclasssubgroupsforgroup.devicemanagementlistdeviceclasssubgroupsforgroup + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-device-class-subgroups-for-group.device-management-list-device-class-subgroups-for-group + PagedIterable response + = deviceManagementClient.listDeviceClassSubgroupsForGroup("group1"); + // END:com.azure.iot.deviceupdate.generated.device-management-list-device-class-subgroups-for-group.device-management-list-device-class-subgroups-for-group } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java index be2e470c8df3..001eeab9b4aa 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClass; public class DeviceManagementListDeviceClasses { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistdeviceclasses.devicemanagementlistdeviceclasses - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDeviceClasses(requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistdeviceclasses.devicemanagementlistdeviceclasses + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-device-classes.device-management-list-device-classes + PagedIterable response = deviceManagementClient.listDeviceClasses(); + // END:com.azure.iot.deviceupdate.generated.device-management-list-device-classes.device-management-list-device-classes } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.java index 130e77ca57d7..067958747964 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.java @@ -1,29 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeploymentDeviceState; public class DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistdevicestatesfordeviceclasssubgroupdeployment.devicemanagementlistdevicestatesfordeviceclasssubgroupdeployment - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = - deviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistdevicestatesfordeviceclasssubgroupdeployment.devicemanagementlistdevicestatesfordeviceclasssubgroupdeployment + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-device-states-for-device-class-subgroup-deployment.device-management-list-device-states-for-device-class-subgroup-deployment + PagedIterable response = deviceManagementClient + .listDeviceStatesForDeviceClassSubgroupDeployment("TestGroup", "deviceClassId", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-list-device-states-for-device-class-subgroup-deployment.device-management-list-device-states-for-device-class-subgroup-deployment } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java index 12c3cf6119ee..ad702e34799a 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Device; public class DeviceManagementListDevices { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistdevices.devicemanagementlistdevices - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDevices(requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistdevices.devicemanagementlistdevices + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-devices.device-management-list-devices + PagedIterable response = deviceManagementClient.listDevices(); + // END:com.azure.iot.deviceupdate.generated.device-management-list-devices.device-management-list-devices } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java index 3355f1bb5757..63b071149cc6 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Group; public class DeviceManagementListGroups { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistgroups.devicemanagementlistgroups - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listGroups(requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistgroups.devicemanagementlistgroups + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-groups.device-management-list-groups + PagedIterable response = deviceManagementClient.listGroups(); + // END:com.azure.iot.deviceupdate.generated.device-management-list-groups.device-management-list-groups } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.java index 153806be6fe4..09024c4653a1 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.java @@ -1,28 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceHealth; public class DeviceManagementListHealthOfDevices { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlisthealthofdevices.devicemanagementlisthealthofdevices - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = - deviceManagementClient.listHealthOfDevices("state eq 'unhealthy'", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlisthealthofdevices.devicemanagementlisthealthofdevices + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-health-of-devices.device-management-list-health-of-devices + PagedIterable response = deviceManagementClient.listHealthOfDevices("state eq 'unhealthy'"); + // END:com.azure.iot.deviceupdate.generated.device-management-list-health-of-devices.device-management-list-health-of-devices } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java index dbfb4bc78ec5..994e00f8f280 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java @@ -1,28 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateInfo; public class DeviceManagementListInstallableUpdatesForDeviceClass { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistinstallableupdatesfordeviceclass.devicemanagementlistinstallableupdatesfordeviceclass - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = - deviceManagementClient.listInstallableUpdatesForDeviceClass("deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistinstallableupdatesfordeviceclass.devicemanagementlistinstallableupdatesfordeviceclass + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-installable-updates-for-device-class.device-management-list-installable-updates-for-device-class + PagedIterable response + = deviceManagementClient.listInstallableUpdatesForDeviceClass("deviceClassId"); + // END:com.azure.iot.deviceupdate.generated.device-management-list-installable-updates-for-device-class.device-management-list-installable-updates-for-device-class } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java index 1b751e93e6cf..0fd5137f0c9f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.LogCollection; public class DeviceManagementListLogCollections { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistlogcollections.devicemanagementlistlogcollections - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listLogCollections(requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistlogcollections.devicemanagementlistlogcollections + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-log-collections.device-management-list-log-collections + PagedIterable response = deviceManagementClient.listLogCollections(); + // END:com.azure.iot.deviceupdate.generated.device-management-list-log-collections.device-management-list-log-collections } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java index 53b4f6f9866e..7aea296d7741 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceOperation; public class DeviceManagementListOperationStatuses { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementlistoperationstatuses.devicemanagementlistoperationstatuses - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listOperationStatuses(requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementlistoperationstatuses.devicemanagementlistoperationstatuses + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-list-operation-statuses.device-management-list-operation-statuses + PagedIterable response = deviceManagementClient.listOperationStatuses(null, null); + // END:com.azure.iot.deviceupdate.generated.device-management-list-operation-statuses.device-management-list-operation-statuses } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementRetryDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementRetryDeployment.java new file mode 100644 index 000000000000..c54a8b0f75e3 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementRetryDeployment.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.iot.deviceupdate.DeviceManagementClient; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Deployment; + +public class DeviceManagementRetryDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-retry-deployment.device-management-retry-deployment + Deployment response = deviceManagementClient.retryDeployment("TestGroup", "deviceClassId", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-retry-deployment.device-management-retry-deployment + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.java index dfc074d6c94b..b079bdb92ea8 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.java @@ -1,31 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceUpdateAgentId; +import com.azure.iot.deviceupdate.models.LogCollection; +import java.util.Arrays; public class DeviceManagementStartLogCollection { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementstartlogcollection.devicemanagementstartlogcollection - BinaryData logCollection = - BinaryData.fromString( - "{\"description\":\"Log collection description\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}]}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.startLogCollectionWithResponse("LogCollectionId", logCollection, requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementstartlogcollection.devicemanagementstartlogcollection + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-start-log-collection.device-management-start-log-collection + LogCollection response = deviceManagementClient.startLogCollection("LogCollectionId", + new LogCollection(Arrays.asList(new DeviceUpdateAgentId("DeviceA"), + new DeviceUpdateAgentId("DeviceB").setModuleId("ModuleB"))) + .setDescription("Log collection description")); + // END:com.azure.iot.deviceupdate.generated.device-management-start-log-collection.device-management-start-log-collection } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStopDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStopDeployment.java new file mode 100644 index 000000000000..186dad20efa7 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStopDeployment.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.iot.deviceupdate.DeviceManagementClient; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Deployment; + +public class DeviceManagementStopDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-stop-deployment.device-management-stop-deployment + Deployment response = deviceManagementClient.stopDeployment("TestGroup", "deviceClassId", "deploymentId"); + // END:com.azure.iot.deviceupdate.generated.device-management-stop-deployment.device-management-stop-deployment + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java index 4f7440c3b1a8..895063db288a 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java @@ -1,29 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.DeviceClass; +import com.azure.iot.deviceupdate.models.PatchBody; public class DeviceManagementUpdateDeviceClass { public static void main(String[] args) { - DeviceManagementClient deviceManagementClient = - new DeviceManagementClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.devicemanagementupdatedeviceclass.devicemanagementupdatedeviceclass - BinaryData deviceClassPatch = BinaryData.fromString("{\"friendlyName\":\"GA Webcams\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceManagementClient.updateDeviceClassWithResponse("deviceClassId", deviceClassPatch, requestOptions); - // END:com.azure.iot.deviceupdate.generated.devicemanagementupdatedeviceclass.devicemanagementupdatedeviceclass + DeviceManagementClient deviceManagementClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceManagementClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-management-update-device-class.device-management-update-device-class + DeviceClass response + = deviceManagementClient.updateDeviceClass("deviceClassId", new PatchBody().setFriendlyName("GA Webcams")); + // END:com.azure.iot.deviceupdate.generated.device-management-update-device-class.device-management-update-device-class } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.java index bb94d4be21a2..67df3b75148e 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.java @@ -1,28 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.core.util.polling.SyncPoller; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateOperation; public class DeviceUpdateDeleteUpdate { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdatedeleteupdate.deviceupdatedeleteupdate - RequestOptions requestOptions = new RequestOptions(); - SyncPoller response = - deviceUpdateClient.beginDeleteUpdate("microsoft", "adu", "1.0.0.0", requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdatedeleteupdate.deviceupdatedeleteupdate + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-delete-update.device-update-delete-update + SyncPoller response + = deviceUpdateClient.beginDeleteUpdate("microsoft", "adu", "1.0.0.0"); + // END:com.azure.iot.deviceupdate.generated.device-update-delete-update.device-update-delete-update } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.java index a4b31f3d9c5a..6cb4053c27a6 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateFile; public class DeviceUpdateGetFile { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdategetfile.deviceupdategetfile - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceUpdateClient.getFileWithResponse("microsoft", "adu", "1.0.0.0", "abc123", requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdategetfile.deviceupdategetfile + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-get-file.device-update-get-file + UpdateFile response = deviceUpdateClient.getFile("microsoft", "adu", "1.0.0.0", "abc123", null); + // END:com.azure.iot.deviceupdate.generated.device-update-get-file.device-update-get-file } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.java index dd7fbea56fb7..552e6dfe4150 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.java @@ -1,29 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateOperation; public class DeviceUpdateGetOperationStatus { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdategetoperationstatus.deviceupdategetoperationstatus - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceUpdateClient.getOperationStatusWithResponse( - "e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdategetoperationstatus.deviceupdategetoperationstatus + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-get-operation-status.device-update-get-operation-status + UpdateOperation response = deviceUpdateClient.getOperationStatus("e4491c54-916f-443d-9094-bcca546ace2f", null); + // END:com.azure.iot.deviceupdate.generated.device-update-get-operation-status.device-update-get-operation-status } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.java index 7b92e72a0278..1b6c831b3fd9 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Update; public class DeviceUpdateGetUpdate { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdategetupdate.deviceupdategetupdate - RequestOptions requestOptions = new RequestOptions(); - Response response = - deviceUpdateClient.getUpdateWithResponse("microsoft", "adu", "1.0.0.0", requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdategetupdate.deviceupdategetupdate + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-get-update.device-update-get-update + Update response = deviceUpdateClient.getUpdate("microsoft", "adu", "1.0.0.0", null); + // END:com.azure.iot.deviceupdate.generated.device-update-get-update.device-update-get-update } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.java index f2aca6275327..034498be754e 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.java @@ -1,31 +1,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.core.util.polling.SyncPoller; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.FileImportMetadata; +import com.azure.iot.deviceupdate.models.ImportManifestMetadata; +import com.azure.iot.deviceupdate.models.ImportUpdateInputItem; +import com.azure.iot.deviceupdate.models.UpdateOperation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; public class DeviceUpdateImportUpdate { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdateimportupdate.deviceupdateimportupdate - BinaryData updateToImport = - BinaryData.fromString( - "[{\"files\":[{\"filename\":\"file1.bin\",\"url\":\"http://test.blob.core.windows.net/test/upload1v5uww1q\"},{\"filename\":\"file2.bin\",\"url\":\"http://test.blob.core.windows.net/test/uploadkrmn5yw0\"},{\"filename\":\"file3.bin\",\"url\":\"http://test.blob.core.windows.net/test/uploaddq52ky5m\"}],\"importManifest\":{\"hashes\":{\"sha256\":\"O19LyyncPe1AGstOdkcmozLV8pSbBdqrE18HdYVohRc=\"},\"sizeInBytes\":816,\"url\":\"http://test.blob.core.windows.net/test/uploadimportMan.json\"}}]"); - RequestOptions requestOptions = new RequestOptions(); - SyncPoller response = - deviceUpdateClient.beginImportUpdate(updateToImport, requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdateimportupdate.deviceupdateimportupdate + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-import-update.device-update-import-update + SyncPoller response + = deviceUpdateClient.beginImportUpdate(Arrays.asList(new ImportUpdateInputItem(new ImportManifestMetadata( + "http://test.blob.core.windows.net/test/uploadimportMan.json", 816L, + mapOf("sha256", "O19LyyncPe1AGstOdkcmozLV8pSbBdqrE18HdYVohRc="))).setFiles(Arrays.asList( + new FileImportMetadata("file1.bin", "http://test.blob.core.windows.net/test/upload1v5uww1q"), + new FileImportMetadata("file2.bin", "http://test.blob.core.windows.net/test/uploadkrmn5yw0"), + new FileImportMetadata("file3.bin", "http://test.blob.core.windows.net/test/uploaddq52ky5m"))))); + // END:com.azure.iot.deviceupdate.generated.device-update-import-update.device-update-import-update + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.java index 87dc0b110f17..60e0ce7fea4f 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.java @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceUpdateListFiles { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdatelistfiles.deviceupdatelistfiles - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = - deviceUpdateClient.listFiles("microsoft", "adu", "1.0.0.0", requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdatelistfiles.deviceupdatelistfiles + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-list-files.device-update-list-files + PagedIterable response = deviceUpdateClient.listFiles("microsoft", "adu", "1.0.0.0"); + // END:com.azure.iot.deviceupdate.generated.device-update-list-files.device-update-list-files } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java index 3ad39d2f7f3e..c53361cc9693 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java @@ -1,27 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceUpdateListNames { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdatelistnames.deviceupdatelistnames - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listNames("microsoft", requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdatelistnames.deviceupdatelistnames + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-list-names.device-update-list-names + PagedIterable response = deviceUpdateClient.listNames("microsoft"); + // END:com.azure.iot.deviceupdate.generated.device-update-list-names.device-update-list-names } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java index 292a2174a726..c5cf49d95549 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.UpdateOperation; public class DeviceUpdateListOperationStatuses { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdatelistoperationstatuses.deviceupdatelistoperationstatuses - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listOperationStatuses(requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdatelistoperationstatuses.deviceupdatelistoperationstatuses + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-list-operation-statuses.device-update-list-operation-statuses + PagedIterable response = deviceUpdateClient.listOperationStatuses(null, null); + // END:com.azure.iot.deviceupdate.generated.device-update-list-operation-statuses.device-update-list-operation-statuses } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java index 20a5fc225f6e..077f5bc52b36 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java @@ -1,27 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceUpdateListProviders { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdatelistproviders.deviceupdatelistproviders - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listProviders(requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdatelistproviders.deviceupdatelistproviders + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-list-providers.device-update-list-providers + PagedIterable response = deviceUpdateClient.listProviders(); + // END:com.azure.iot.deviceupdate.generated.device-update-list-providers.device-update-list-providers } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java index 13c2752544f6..7b9d8dcece30 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.iot.deviceupdate.models.Update; public class DeviceUpdateListUpdates { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdatelistupdates.deviceupdatelistupdates - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listUpdates(requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdatelistupdates.deviceupdatelistupdates + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-list-updates.device-update-list-updates + PagedIterable response = deviceUpdateClient.listUpdates(null, null); + // END:com.azure.iot.deviceupdate.generated.device-update-list-updates.device-update-list-updates } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java index 3928fdcd3f7f..d207049960a9 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java @@ -1,27 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.iot.deviceupdate.generated; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.iot.deviceupdate.DeviceUpdateClient; import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; public class DeviceUpdateListVersions { public static void main(String[] args) { - DeviceUpdateClient deviceUpdateClient = - new DeviceUpdateClientBuilder() - .credential(new DefaultAzureCredentialBuilder().build()) - .endpoint("contoso.api.adu.microsoft.com") - .instanceId("blue") - .buildClient(); - // BEGIN:com.azure.iot.deviceupdate.generated.deviceupdatelistversions.deviceupdatelistversions - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listVersions("microsoft", "adu", requestOptions); - // END:com.azure.iot.deviceupdate.generated.deviceupdatelistversions.deviceupdatelistversions + DeviceUpdateClient deviceUpdateClient + = new DeviceUpdateClientBuilder().credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildDeviceUpdateClient(); + // BEGIN:com.azure.iot.deviceupdate.generated.device-update-list-versions.device-update-list-versions + PagedIterable response = deviceUpdateClient.listVersions("microsoft", "adu"); + // END:com.azure.iot.deviceupdate.generated.device-update-list-versions.device-update-list-versions } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceManagementClientTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceManagementClientTests.java index e70a57441ca7..4911dba9a813 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceManagementClientTests.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceManagementClientTests.java @@ -7,6 +7,7 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.test.TestProxyTestBase; import com.azure.core.util.BinaryData; @@ -37,7 +38,7 @@ private DeviceManagementAsyncClient createClient() { @Test public void testListDevices() { DeviceManagementAsyncClient client = createClient(); - PagedFlux response = client.listDevices(null); + PagedFlux response = client.listDevices((RequestOptions) null); assertNotNull(response); assertTrue(response.toStream().count() > 0); @@ -57,7 +58,7 @@ public void testGetDeviceNotFound() { @Test public void testGetGroups() { DeviceManagementAsyncClient client = createClient(); - PagedFlux response = client.listGroups(null); + PagedFlux response = client.listGroups((RequestOptions) null); assertNotNull(response); assertTrue(response.toStream().count() > 0); @@ -84,7 +85,7 @@ public void testGetGroupNotFound() { @Test public void testGetDeviceClasses() { DeviceManagementAsyncClient client = createClient(); - PagedFlux response = client.listDeviceClasses(null); + PagedFlux response = client.listDeviceClasses((RequestOptions) null); assertNotNull(response); assertTrue(response.toStream().count() > 0); @@ -127,7 +128,7 @@ public void testGetBestUpdatesForGroupNotFound() { // @Test public void testGetDeploymentsForGroup() { DeviceManagementAsyncClient client = createClient(); - PagedFlux response = client.listDeploymentsForGroup(TestData.DEVICE_GROUP, null); + PagedFlux response = client.listDeploymentsForGroup(TestData.DEVICE_GROUP, (RequestOptions) null); assertNotNull(response); assertTrue(response.toStream().count() > 0); @@ -138,7 +139,7 @@ public void testGetDeploymentsForGroupNotFound() { DeviceManagementAsyncClient client = createClient(); try { - PagedFlux response = client.listDeploymentsForGroup("foo", null); + PagedFlux response = client.listDeploymentsForGroup("foo", (RequestOptions) null); long count = response.toStream().count(); fail("NotFound response expected"); } catch (HttpResponseException e) { diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientSyncStackTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientSyncStackTests.java index fd44b832da0d..339678bc3765 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientSyncStackTests.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientSyncStackTests.java @@ -35,7 +35,7 @@ protected void beforeTest() { clientBuilder.addPolicy(interceptorManager.getRecordPolicy()); } - deviceUpdateClient = clientBuilder.credential(getCredential(getTestMode())).buildClient(); + deviceUpdateClient = clientBuilder.credential(getCredential(getTestMode())).buildDeviceUpdateClient(); requestOptions = new RequestOptions(); } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientTests.java index f9f30625f8ff..8c0377b00962 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientTests.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientTests.java @@ -7,6 +7,7 @@ import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.test.TestProxyTestBase; import com.azure.core.util.BinaryData; @@ -32,7 +33,7 @@ private DeviceUpdateAsyncClient createClient() { clientBuilder.addPolicy(interceptorManager.getRecordPolicy()); } - return clientBuilder.credential(getCredential(getTestMode())).buildAsyncClient(); + return clientBuilder.credential(getCredential(getTestMode())).buildDeviceUpdateAsyncClient(); } @Test @@ -69,7 +70,7 @@ public void testGetNamesNotFound() { @Test public void testGetVersions() { DeviceUpdateAsyncClient client = createClient(); - PagedFlux response = client.listVersions(TestData.PROVIDER, TestData.NAME, null); + PagedFlux response = client.listVersions(TestData.PROVIDER, TestData.NAME, (RequestOptions) null); assertNotNull(response); assertTrue(response.toStream().count() > 0); @@ -80,7 +81,7 @@ public void testGetVersionsNotFound() { DeviceUpdateAsyncClient client = createClient(); try { - PagedFlux response = client.listVersions("foo", "bar", null); + PagedFlux response = client.listVersions("foo", "bar", (RequestOptions) null); long count = response.toStream().count(); fail("NotFound response expected"); } catch (HttpResponseException e) { diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java new file mode 100644 index 000000000000..d2e3f26d4726 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.DownloadSecurity; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import java.time.OffsetDateTime; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementCreateOrUpdateDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementCreateOrUpdateDeploymentTests() { + // method invocation + Deployment response = deviceManagementClient.createOrUpdateDeployment("TestGroup", "deploymentId", + new Deployment("deploymentId", OffsetDateTime.parse("2020-04-22T05:12:12-07:00"), + new UpdateInfo(new UpdateId("provider", "name", "1.2.3.4")), "TestGroup") + .setRollbackPolicy( + new CloudInitiatedRollbackPolicy(new UpdateInfo(new UpdateId("provider", "name", "1.2.3.3")), + new CloudInitiatedRollbackPolicyFailure(50, 100))) + .setDownloadSecurity(DownloadSecurity.HTTPS)); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deploymentId" + Assertions.assertEquals("deploymentId", response.getDeploymentId()); + // verify property "startDateTime" + Assertions.assertNotNull(response.getStartDateTime()); + // verify property "update" + UpdateInfo responseUpdate = response.getUpdate(); + Assertions.assertNotNull(responseUpdate); + UpdateId responseUpdateUpdateId = responseUpdate.getUpdateId(); + Assertions.assertNotNull(responseUpdateUpdateId); + Assertions.assertEquals("provider", responseUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.4", responseUpdateUpdateId.getVersion()); + // verify property "groupId" + Assertions.assertEquals("TestGroup", response.getGroupId()); + // verify property "deviceClassSubgroups" + List responseDeviceClassSubgroups = response.getDeviceClassSubgroups(); + Assertions.assertEquals("deviceClassId1", responseDeviceClassSubgroups.iterator().next()); + // verify property "rollbackPolicy" + CloudInitiatedRollbackPolicy responseRollbackPolicy = response.getRollbackPolicy(); + Assertions.assertNotNull(responseRollbackPolicy); + UpdateInfo responseRollbackPolicyUpdate = responseRollbackPolicy.getUpdate(); + Assertions.assertNotNull(responseRollbackPolicyUpdate); + UpdateId responseRollbackPolicyUpdateUpdateId = responseRollbackPolicyUpdate.getUpdateId(); + Assertions.assertNotNull(responseRollbackPolicyUpdateUpdateId); + Assertions.assertEquals("provider", responseRollbackPolicyUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseRollbackPolicyUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.3", responseRollbackPolicyUpdateUpdateId.getVersion()); + CloudInitiatedRollbackPolicyFailure responseRollbackPolicyFailure = responseRollbackPolicy.getFailure(); + Assertions.assertNotNull(responseRollbackPolicyFailure); + Assertions.assertEquals(50, responseRollbackPolicyFailure.getDevicesFailedPercentage()); + Assertions.assertEquals(100, responseRollbackPolicyFailure.getDevicesFailedCount()); + // verify property "downloadSecurity" + Assertions.assertEquals(DownloadSecurity.HTTPS, response.getDownloadSecurity()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..d1db0b56ce88 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeploymentForDeviceClassSubgroupTests() { + // method invocation + deviceManagementClient.deleteDeploymentForDeviceClassSubgroup("TestGroup", "deviceClassId", "deploymentId"); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java new file mode 100644 index 000000000000..e2fb920d2dd1 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementDeleteDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeploymentTests() { + // method invocation + deviceManagementClient.deleteDeployment("TestGroup", "deploymentId"); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..b82f507b3ee2 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementDeleteDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeviceClassSubgroupTests() { + // method invocation + deviceManagementClient.deleteDeviceClassSubgroup("group1", "deviceClassId"); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java new file mode 100644 index 000000000000..38a90f6f80e9 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementDeleteDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeviceClassTests() { + // method invocation + deviceManagementClient.deleteDeviceClass("deviceClass1"); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroupTests.java new file mode 100644 index 000000000000..b5cf99110ffe --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroupTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementDeleteGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteGroupTests() { + // method invocation + deviceManagementClient.deleteGroup("group1"); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetBestUpdatesForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetBestUpdatesForDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..9799bf939961 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetBestUpdatesForDeviceClassSubgroupTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetBestUpdatesForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetBestUpdatesForDeviceClassSubgroupTests() { + // method invocation + DeviceClassSubgroupUpdatableDevices response + = deviceManagementClient.getBestUpdatesForDeviceClassSubgroup("group1", "deviceClassId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "groupId" + Assertions.assertEquals("group1", response.getGroupId()); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId", response.getDeviceClassId()); + // verify property "update" + UpdateInfo responseUpdate = response.getUpdate(); + Assertions.assertNotNull(responseUpdate); + UpdateId responseUpdateUpdateId = responseUpdate.getUpdateId(); + Assertions.assertNotNull(responseUpdateUpdateId); + Assertions.assertEquals("provider", responseUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", responseUpdateUpdateId.getVersion()); + Assertions.assertEquals("July 2022 Update", responseUpdate.getFriendlyName()); + // verify property "deviceCount" + Assertions.assertEquals(100, response.getDeviceCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..b4dd1ad85342 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeploymentForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeploymentForDeviceClassSubgroupTests() { + // method invocation + Deployment response + = deviceManagementClient.getDeploymentForDeviceClassSubgroup("TestGroup", "deviceClassId", "deploymentId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deploymentId" + Assertions.assertEquals("deploymentId", response.getDeploymentId()); + // verify property "startDateTime" + Assertions.assertNotNull(response.getStartDateTime()); + // verify property "update" + UpdateInfo responseUpdate = response.getUpdate(); + Assertions.assertNotNull(responseUpdate); + UpdateId responseUpdateUpdateId = responseUpdate.getUpdateId(); + Assertions.assertNotNull(responseUpdateUpdateId); + Assertions.assertEquals("provider", responseUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.4", responseUpdateUpdateId.getVersion()); + // verify property "groupId" + Assertions.assertEquals("TestGroup", response.getGroupId()); + // verify property "isCanceled" + Assertions.assertEquals(false, response.isCanceled()); + // verify property "isRetried" + Assertions.assertEquals(false, response.isRetried()); + // verify property "rollbackPolicy" + CloudInitiatedRollbackPolicy responseRollbackPolicy = response.getRollbackPolicy(); + Assertions.assertNotNull(responseRollbackPolicy); + UpdateInfo responseRollbackPolicyUpdate = responseRollbackPolicy.getUpdate(); + Assertions.assertNotNull(responseRollbackPolicyUpdate); + UpdateId responseRollbackPolicyUpdateUpdateId = responseRollbackPolicyUpdate.getUpdateId(); + Assertions.assertNotNull(responseRollbackPolicyUpdateUpdateId); + Assertions.assertEquals("provider", responseRollbackPolicyUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseRollbackPolicyUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.3", responseRollbackPolicyUpdateUpdateId.getVersion()); + CloudInitiatedRollbackPolicyFailure responseRollbackPolicyFailure = responseRollbackPolicy.getFailure(); + Assertions.assertNotNull(responseRollbackPolicyFailure); + Assertions.assertEquals(50, responseRollbackPolicyFailure.getDevicesFailedPercentage()); + Assertions.assertEquals(100, responseRollbackPolicyFailure.getDevicesFailedCount()); + // verify property "isCloudInitiatedRollback" + Assertions.assertEquals(false, response.isCloudInitiatedRollback()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java new file mode 100644 index 000000000000..856a9d63fdb6 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.DeploymentState; +import com.azure.iot.deviceupdate.models.DeploymentStatus; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeploymentStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeploymentStatusTests() { + // method invocation + DeploymentStatus response = deviceManagementClient.getDeploymentStatus("TestGroup", "deploymentId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "groupId" + Assertions.assertEquals("TestGroup", response.getGroupId()); + // verify property "deploymentState" + Assertions.assertEquals(DeploymentState.ACTIVE_WITH_SUBGROUP_FAILURES, response.getDeploymentState()); + // verify property "subgroupStatus" + List responseSubgroupStatus = response.getSubgroupStatus(); + DeviceClassSubgroupDeploymentStatus responseSubgroupStatusFirstItem = responseSubgroupStatus.iterator().next(); + Assertions.assertNotNull(responseSubgroupStatusFirstItem); + Assertions.assertEquals("TestGroup", responseSubgroupStatusFirstItem.getGroupId()); + Assertions.assertEquals("deviceClassId1", responseSubgroupStatusFirstItem.getDeviceClassId()); + Assertions.assertEquals(DeviceClassSubgroupDeploymentState.ACTIVE, + responseSubgroupStatusFirstItem.getDeploymentState()); + Assertions.assertEquals(1, responseSubgroupStatusFirstItem.getTotalDevices()); + Assertions.assertEquals(0, responseSubgroupStatusFirstItem.getDevicesInProgressCount()); + Assertions.assertEquals(0, responseSubgroupStatusFirstItem.getDevicesCompletedFailedCount()); + Assertions.assertEquals(1, responseSubgroupStatusFirstItem.getDevicesCompletedSucceededCount()); + Assertions.assertEquals(0, responseSubgroupStatusFirstItem.getDevicesCanceledCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentTests.java new file mode 100644 index 000000000000..ba4948006825 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentTests.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.DownloadSecurity; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeploymentTests() { + // method invocation + Deployment response = deviceManagementClient.getDeployment("TestGroup", "deploymentId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deploymentId" + Assertions.assertEquals("deploymentId", response.getDeploymentId()); + // verify property "startDateTime" + Assertions.assertNotNull(response.getStartDateTime()); + // verify property "update" + UpdateInfo responseUpdate = response.getUpdate(); + Assertions.assertNotNull(responseUpdate); + UpdateId responseUpdateUpdateId = responseUpdate.getUpdateId(); + Assertions.assertNotNull(responseUpdateUpdateId); + Assertions.assertEquals("provider", responseUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.4", responseUpdateUpdateId.getVersion()); + Assertions.assertEquals("This update fixes a security issue.", responseUpdate.getDescription()); + Assertions.assertEquals("Contoso Toaster v1.2.3.4", responseUpdate.getFriendlyName()); + // verify property "groupId" + Assertions.assertEquals("TestGroup", response.getGroupId()); + // verify property "deviceClassSubgroups" + List responseDeviceClassSubgroups = response.getDeviceClassSubgroups(); + Assertions.assertEquals("deviceClassId1", responseDeviceClassSubgroups.iterator().next()); + // verify property "isCanceled" + Assertions.assertEquals(false, response.isCanceled()); + // verify property "isRetried" + Assertions.assertEquals(false, response.isRetried()); + // verify property "rollbackPolicy" + CloudInitiatedRollbackPolicy responseRollbackPolicy = response.getRollbackPolicy(); + Assertions.assertNotNull(responseRollbackPolicy); + UpdateInfo responseRollbackPolicyUpdate = responseRollbackPolicy.getUpdate(); + Assertions.assertNotNull(responseRollbackPolicyUpdate); + UpdateId responseRollbackPolicyUpdateUpdateId = responseRollbackPolicyUpdate.getUpdateId(); + Assertions.assertNotNull(responseRollbackPolicyUpdateUpdateId); + Assertions.assertEquals("provider", responseRollbackPolicyUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseRollbackPolicyUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.3", responseRollbackPolicyUpdateUpdateId.getVersion()); + Assertions.assertEquals("This update fixes a security issue.", responseRollbackPolicyUpdate.getDescription()); + Assertions.assertEquals("Contoso Toaster v1.2.3.3", responseRollbackPolicyUpdate.getFriendlyName()); + CloudInitiatedRollbackPolicyFailure responseRollbackPolicyFailure = responseRollbackPolicy.getFailure(); + Assertions.assertNotNull(responseRollbackPolicyFailure); + Assertions.assertEquals(50, responseRollbackPolicyFailure.getDevicesFailedPercentage()); + Assertions.assertEquals(100, responseRollbackPolicyFailure.getDevicesFailedCount()); + // verify property "isCloudInitiatedRollback" + Assertions.assertEquals(false, response.isCloudInitiatedRollback()); + // verify property "downloadSecurity" + Assertions.assertEquals(DownloadSecurity.HTTPS, response.getDownloadSecurity()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java new file mode 100644 index 000000000000..b87b539befd8 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentState; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupDeploymentStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceClassSubgroupDeploymentStatusTests() { + // method invocation + DeviceClassSubgroupDeploymentStatus response = deviceManagementClient + .getDeviceClassSubgroupDeploymentStatus("TestGroup", "deviceClassId", "deploymentId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "groupId" + Assertions.assertEquals("TestGroup", response.getGroupId()); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId", response.getDeviceClassId()); + // verify property "deploymentState" + Assertions.assertEquals(DeviceClassSubgroupDeploymentState.ACTIVE, response.getDeploymentState()); + // verify property "totalDevices" + Assertions.assertEquals(1, response.getTotalDevices()); + // verify property "devicesInProgressCount" + Assertions.assertEquals(0, response.getDevicesInProgressCount()); + // verify property "devicesCompletedFailedCount" + Assertions.assertEquals(0, response.getDevicesCompletedFailedCount()); + // verify property "devicesCompletedSucceededCount" + Assertions.assertEquals(1, response.getDevicesCompletedSucceededCount()); + // verify property "devicesCanceledCount" + Assertions.assertEquals(0, response.getDevicesCanceledCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..498189cd409b --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.DeviceClassSubgroup; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceClassSubgroupTests() { + // method invocation + DeviceClassSubgroup response = deviceManagementClient.getDeviceClassSubgroup("group1", "deviceClassId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deviceClassId" + Assertions.assertEquals("DeviceClassId", response.getDeviceClassId()); + // verify property "groupId" + Assertions.assertEquals("group1", response.getGroupId()); + // verify property "createdDateTime" + Assertions.assertEquals("2020-07-01T12:13:14Z", response.getCreatedDateTime()); + // verify property "deviceCount" + Assertions.assertEquals(149, response.getDeviceCount()); + // verify property "deploymentId" + Assertions.assertEquals("MyDeployment", response.getDeploymentId()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java new file mode 100644 index 000000000000..61da0805a513 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.UpdateCompliance; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceClassSubgroupUpdateComplianceTests() { + // method invocation + UpdateCompliance response + = deviceManagementClient.getDeviceClassSubgroupUpdateCompliance("group1", "deviceClassId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "totalDeviceCount" + Assertions.assertEquals(302204, response.getTotalDeviceCount()); + // verify property "onLatestUpdateDeviceCount" + Assertions.assertEquals(256873, response.getOnLatestUpdateDeviceCount()); + // verify property "newUpdatesAvailableDeviceCount" + Assertions.assertEquals(36265, response.getNewUpdatesAvailableDeviceCount()); + // verify property "updatesInProgressDeviceCount" + Assertions.assertEquals(9066, response.getUpdatesInProgressDeviceCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java new file mode 100644 index 000000000000..815c5f79266b --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.ContractModel; +import com.azure.iot.deviceupdate.models.DeviceClass; +import com.azure.iot.deviceupdate.models.DeviceClassProperties; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceClassTests() { + // method invocation + DeviceClass response = deviceManagementClient.getDeviceClass("deviceClassId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId", response.getDeviceClassId()); + // verify property "friendlyName" + Assertions.assertEquals("DeviceClass2020-04-22T12:12:12.0000000+00:00", response.getFriendlyName()); + // verify property "deviceClassProperties" + DeviceClassProperties responseDeviceClassProperties = response.getDeviceClassProperties(); + Assertions.assertNotNull(responseDeviceClassProperties); + ContractModel responseDeviceClassPropertiesContractModel = responseDeviceClassProperties.getContractModel(); + Assertions.assertNotNull(responseDeviceClassPropertiesContractModel); + Assertions.assertEquals("dtmi:azure:iot:deviceUpdateContractModel;2", + responseDeviceClassPropertiesContractModel.getId()); + Assertions.assertEquals("Device Update Model V2", responseDeviceClassPropertiesContractModel.getName()); + Assertions.assertNotNull(responseDeviceClassProperties.getCompatProperties()); + // verify property "bestCompatibleUpdate" + UpdateInfo responseBestCompatibleUpdate = response.getBestCompatibleUpdate(); + Assertions.assertNotNull(responseBestCompatibleUpdate); + UpdateId responseBestCompatibleUpdateUpdateId = responseBestCompatibleUpdate.getUpdateId(); + Assertions.assertNotNull(responseBestCompatibleUpdateUpdateId); + Assertions.assertEquals("provider", responseBestCompatibleUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseBestCompatibleUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", responseBestCompatibleUpdateUpdateId.getVersion()); + Assertions.assertEquals("July 2022 Update", responseBestCompatibleUpdate.getFriendlyName()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceModuleTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceModuleTests.java new file mode 100644 index 000000000000..588bbd1e338c --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceModuleTests.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.Device; +import com.azure.iot.deviceupdate.models.DeviceDeploymentState; +import com.azure.iot.deviceupdate.models.InstallResult; +import com.azure.iot.deviceupdate.models.StepResult; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeviceModuleTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceModuleTests() { + // method invocation + Device response = deviceManagementClient.getDeviceModule("deviceId", "moduleId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deviceId" + Assertions.assertEquals("device1", response.getDeviceId()); + // verify property "moduleId" + Assertions.assertEquals("module1", response.getModuleId()); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId1", response.getDeviceClassId()); + // verify property "lastAttemptedUpdate" + UpdateInfo responseLastAttemptedUpdate = response.getLastAttemptedUpdate(); + Assertions.assertNotNull(responseLastAttemptedUpdate); + UpdateId responseLastAttemptedUpdateUpdateId = responseLastAttemptedUpdate.getUpdateId(); + Assertions.assertNotNull(responseLastAttemptedUpdateUpdateId); + Assertions.assertEquals("provider1", responseLastAttemptedUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", responseLastAttemptedUpdateUpdateId.getName()); + Assertions.assertEquals("2.0.0.0", responseLastAttemptedUpdateUpdateId.getVersion()); + // verify property "deploymentStatus" + Assertions.assertEquals(DeviceDeploymentState.FAILED, response.getDeploymentStatus()); + // verify property "installedUpdate" + UpdateInfo responseInstalledUpdate = response.getInstalledUpdate(); + Assertions.assertNotNull(responseInstalledUpdate); + UpdateId responseInstalledUpdateUpdateId = responseInstalledUpdate.getUpdateId(); + Assertions.assertNotNull(responseInstalledUpdateUpdateId); + Assertions.assertEquals("provider1", responseInstalledUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", responseInstalledUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", responseInstalledUpdateUpdateId.getVersion()); + // verify property "onLatestUpdate" + Assertions.assertEquals(false, response.isOnLatestUpdate()); + // verify property "lastInstallResult" + InstallResult responseLastInstallResult = response.getLastInstallResult(); + Assertions.assertNotNull(responseLastInstallResult); + Assertions.assertEquals(200, responseLastInstallResult.getResultCode()); + Assertions.assertEquals(0, responseLastInstallResult.getExtendedResultCode()); + Assertions.assertEquals("", responseLastInstallResult.getResultDetails()); + List responseLastInstallResultStepResults = responseLastInstallResult.getStepResults(); + StepResult responseLastInstallResultStepResultsFirstItem + = responseLastInstallResultStepResults.iterator().next(); + Assertions.assertNotNull(responseLastInstallResultStepResultsFirstItem); + UpdateInfo responseLastInstallResultStepResultsFirstItemUpdate + = responseLastInstallResultStepResultsFirstItem.getUpdate(); + Assertions.assertNotNull(responseLastInstallResultStepResultsFirstItemUpdate); + UpdateId responseLastInstallResultStepResultsFirstItemUpdateUpdateId + = responseLastInstallResultStepResultsFirstItemUpdate.getUpdateId(); + Assertions.assertNotNull(responseLastInstallResultStepResultsFirstItemUpdateUpdateId); + Assertions.assertEquals("microsoft", responseLastInstallResultStepResultsFirstItemUpdateUpdateId.getProvider()); + Assertions.assertEquals("peripheralcamera", + responseLastInstallResultStepResultsFirstItemUpdateUpdateId.getName()); + Assertions.assertEquals("1.0", responseLastInstallResultStepResultsFirstItemUpdateUpdateId.getVersion()); + Assertions.assertEquals(200, responseLastInstallResultStepResultsFirstItem.getResultCode()); + Assertions.assertEquals(0, responseLastInstallResultStepResultsFirstItem.getExtendedResultCode()); + Assertions.assertEquals("", responseLastInstallResultStepResultsFirstItem.getResultDetails()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceTests.java new file mode 100644 index 000000000000..c1744bfc907d --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceTests.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.Device; +import com.azure.iot.deviceupdate.models.DeviceDeploymentState; +import com.azure.iot.deviceupdate.models.InstallResult; +import com.azure.iot.deviceupdate.models.StepResult; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetDeviceTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceTests() { + // method invocation + Device response = deviceManagementClient.getDevice("deviceId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deviceId" + Assertions.assertEquals("device1", response.getDeviceId()); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClass1", response.getDeviceClassId()); + // verify property "lastAttemptedUpdate" + UpdateInfo responseLastAttemptedUpdate = response.getLastAttemptedUpdate(); + Assertions.assertNotNull(responseLastAttemptedUpdate); + UpdateId responseLastAttemptedUpdateUpdateId = responseLastAttemptedUpdate.getUpdateId(); + Assertions.assertNotNull(responseLastAttemptedUpdateUpdateId); + Assertions.assertEquals("provider1", responseLastAttemptedUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", responseLastAttemptedUpdateUpdateId.getName()); + Assertions.assertEquals("2.0.0.0", responseLastAttemptedUpdateUpdateId.getVersion()); + Assertions.assertEquals("Fixes performance issue.", responseLastAttemptedUpdate.getDescription()); + // verify property "deploymentStatus" + Assertions.assertEquals(DeviceDeploymentState.FAILED, response.getDeploymentStatus()); + // verify property "installedUpdate" + UpdateInfo responseInstalledUpdate = response.getInstalledUpdate(); + Assertions.assertNotNull(responseInstalledUpdate); + UpdateId responseInstalledUpdateUpdateId = responseInstalledUpdate.getUpdateId(); + Assertions.assertNotNull(responseInstalledUpdateUpdateId); + Assertions.assertEquals("provider1", responseInstalledUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", responseInstalledUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", responseInstalledUpdateUpdateId.getVersion()); + Assertions.assertEquals("Fixes security issue.", responseInstalledUpdate.getDescription()); + // verify property "onLatestUpdate" + Assertions.assertEquals(false, response.isOnLatestUpdate()); + // verify property "lastInstallResult" + InstallResult responseLastInstallResult = response.getLastInstallResult(); + Assertions.assertNotNull(responseLastInstallResult); + Assertions.assertEquals(200, responseLastInstallResult.getResultCode()); + Assertions.assertEquals(0, responseLastInstallResult.getExtendedResultCode()); + Assertions.assertEquals("", responseLastInstallResult.getResultDetails()); + List responseLastInstallResultStepResults = responseLastInstallResult.getStepResults(); + StepResult responseLastInstallResultStepResultsFirstItem + = responseLastInstallResultStepResults.iterator().next(); + Assertions.assertNotNull(responseLastInstallResultStepResultsFirstItem); + UpdateInfo responseLastInstallResultStepResultsFirstItemUpdate + = responseLastInstallResultStepResultsFirstItem.getUpdate(); + Assertions.assertNotNull(responseLastInstallResultStepResultsFirstItemUpdate); + UpdateId responseLastInstallResultStepResultsFirstItemUpdateUpdateId + = responseLastInstallResultStepResultsFirstItemUpdate.getUpdateId(); + Assertions.assertNotNull(responseLastInstallResultStepResultsFirstItemUpdateUpdateId); + Assertions.assertEquals("microsoft", responseLastInstallResultStepResultsFirstItemUpdateUpdateId.getProvider()); + Assertions.assertEquals("peripheralcamera", + responseLastInstallResultStepResultsFirstItemUpdateUpdateId.getName()); + Assertions.assertEquals("1.0", responseLastInstallResultStepResultsFirstItemUpdateUpdateId.getVersion()); + Assertions.assertEquals("Microsoft Peripheral Camera 1.0", + responseLastInstallResultStepResultsFirstItemUpdate.getFriendlyName()); + Assertions.assertEquals(200, responseLastInstallResultStepResultsFirstItem.getResultCode()); + Assertions.assertEquals(0, responseLastInstallResultStepResultsFirstItem.getExtendedResultCode()); + Assertions.assertEquals("", responseLastInstallResultStepResultsFirstItem.getResultDetails()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupTests.java new file mode 100644 index 000000000000..7c2a193c915b --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.Group; +import com.azure.iot.deviceupdate.models.GroupType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetGroupTests() { + // method invocation + Group response = deviceManagementClient.getGroup("group1"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "groupId" + Assertions.assertEquals("MyGroup", response.getGroupId()); + // verify property "groupType" + Assertions.assertEquals(GroupType.IO_THUB_TAG, response.getGroupType()); + // verify property "createdDateTime" + Assertions.assertEquals("2020-07-01T12:13:14Z", response.getCreatedDateTime()); + // verify property "deviceCount" + Assertions.assertEquals(149, response.getDeviceCount()); + // verify property "subgroupsWithNewUpdatesAvailableCount" + Assertions.assertEquals(3, response.getSubgroupsWithNewUpdatesAvailableCount()); + // verify property "subgroupsWithUpdatesInProgressCount" + Assertions.assertEquals(0, response.getSubgroupsWithUpdatesInProgressCount()); + // verify property "subgroupsWithOnLatestUpdateCount" + Assertions.assertEquals(1, response.getSubgroupsWithOnLatestUpdateCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatusTests.java new file mode 100644 index 000000000000..866f144dc36a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatusTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.LogCollectionOperationDetailedStatus; +import com.azure.iot.deviceupdate.models.LogCollectionOperationDeviceStatus; +import com.azure.iot.deviceupdate.models.OperationStatus; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetLogCollectionDetailedStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetLogCollectionDetailedStatusTests() { + // method invocation + LogCollectionOperationDetailedStatus response + = deviceManagementClient.getLogCollectionDetailedStatus("LogCollectionId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "logCollectionId" + Assertions.assertEquals("LogCollectionId", response.getLogCollectionId()); + // verify property "createdDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", response.getCreatedDateTime()); + // verify property "lastActionDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", response.getLastActionDateTime()); + // verify property "status" + Assertions.assertEquals(OperationStatus.NOT_STARTED, response.getStatus()); + // verify property "deviceStatus" + List responseDeviceStatus = response.getDeviceStatus(); + LogCollectionOperationDeviceStatus responseDeviceStatusFirstItem = responseDeviceStatus.iterator().next(); + Assertions.assertNotNull(responseDeviceStatusFirstItem); + Assertions.assertEquals("DeviceA", responseDeviceStatusFirstItem.getDeviceId()); + Assertions.assertEquals(OperationStatus.NOT_STARTED, responseDeviceStatusFirstItem.getStatus()); + Assertions.assertEquals("200", responseDeviceStatusFirstItem.getResultCode()); + Assertions.assertEquals("0", responseDeviceStatusFirstItem.getExtendedResultCode()); + Assertions.assertEquals("/storageAccount/deviceUpdateInstanceName/DeviceA/LogCollectionId", + responseDeviceStatusFirstItem.getLogLocation()); + // verify property "description" + Assertions.assertEquals("Log collection description", response.getDescription()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionTests.java new file mode 100644 index 000000000000..52f04f031e01 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.DeviceUpdateAgentId; +import com.azure.iot.deviceupdate.models.LogCollection; +import com.azure.iot.deviceupdate.models.OperationStatus; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetLogCollectionTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetLogCollectionTests() { + // method invocation + LogCollection response = deviceManagementClient.getLogCollection("LogCollectionId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "logCollectionId" + Assertions.assertEquals("LogCollectionId", response.getLogCollectionId()); + // verify property "deviceList" + List responseDeviceList = response.getDeviceList(); + DeviceUpdateAgentId responseDeviceListFirstItem = responseDeviceList.iterator().next(); + Assertions.assertNotNull(responseDeviceListFirstItem); + Assertions.assertEquals("DeviceA", responseDeviceListFirstItem.getDeviceId()); + // verify property "description" + Assertions.assertEquals("Log collection description", response.getDescription()); + // verify property "createdDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", response.getCreatedDateTime()); + // verify property "lastActionDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", response.getLastActionDateTime()); + // verify property "status" + Assertions.assertEquals(OperationStatus.NOT_STARTED, response.getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatusTests.java new file mode 100644 index 000000000000..0720eea3d1b4 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatusTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.DeviceOperation; +import com.azure.iot.deviceupdate.models.OperationStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetOperationStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetOperationStatusTests() { + // method invocation + DeviceOperation response + = deviceManagementClient.getOperationStatus("e4491c54-916f-443d-9094-bcca546ace2f", null); + + // response assertion + Assertions.assertNotNull(response); + // verify property "operationId" + Assertions.assertEquals("e4491c54-916f-443d-9094-bcca546ace2f", response.getOperationId()); + // verify property "status" + Assertions.assertEquals(OperationStatus.SUCCEEDED, response.getStatus()); + // verify property "traceId" + Assertions.assertEquals("2b881ef9deaf5d45b0a716ca5b4145ec", response.getTraceId()); + // verify property "lastActionDateTime" + Assertions.assertNotNull(response.getLastActionDateTime()); + // verify property "createdDateTime" + Assertions.assertNotNull(response.getCreatedDateTime()); + // verify property "etag" + Assertions.assertEquals("\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\"", response.getEtag()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroupTests.java new file mode 100644 index 000000000000..952616e7a773 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroupTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.UpdateCompliance; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetUpdateComplianceForGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetUpdateComplianceForGroupTests() { + // method invocation + UpdateCompliance response = deviceManagementClient.getUpdateComplianceForGroup("group1"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "totalDeviceCount" + Assertions.assertEquals(302204, response.getTotalDeviceCount()); + // verify property "onLatestUpdateDeviceCount" + Assertions.assertEquals(256873, response.getOnLatestUpdateDeviceCount()); + // verify property "newUpdatesAvailableDeviceCount" + Assertions.assertEquals(36265, response.getNewUpdatesAvailableDeviceCount()); + // verify property "updatesInProgressDeviceCount" + Assertions.assertEquals(9066, response.getUpdatesInProgressDeviceCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java new file mode 100644 index 000000000000..c917710ada7f --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.UpdateCompliance; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementGetUpdateComplianceTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetUpdateComplianceTests() { + // method invocation + UpdateCompliance response = deviceManagementClient.getUpdateCompliance(); + + // response assertion + Assertions.assertNotNull(response); + // verify property "totalDeviceCount" + Assertions.assertEquals(302204, response.getTotalDeviceCount()); + // verify property "onLatestUpdateDeviceCount" + Assertions.assertEquals(256873, response.getOnLatestUpdateDeviceCount()); + // verify property "newUpdatesAvailableDeviceCount" + Assertions.assertEquals(36265, response.getNewUpdatesAvailableDeviceCount()); + // verify property "updatesInProgressDeviceCount" + Assertions.assertEquals(9066, response.getUpdatesInProgressDeviceCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevicesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevicesTests.java new file mode 100644 index 000000000000..3dc7aea218ac --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevicesTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.iot.deviceupdate.models.DeviceOperation; +import com.azure.iot.deviceupdate.models.ImportType; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementImportDevicesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementImportDevicesTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(deviceManagementClient.beginImportDevices(ImportType.ALL)); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java new file mode 100644 index 000000000000..785940dcce8e --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroupUpdatableDevices; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListBestUpdatesForGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListBestUpdatesForGroupTests() { + // method invocation + PagedIterable response + = deviceManagementClient.listBestUpdatesForGroup("group1"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DeviceClassSubgroupUpdatableDevices firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "groupId" + Assertions.assertEquals("group1", firstItem.getGroupId()); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId1", firstItem.getDeviceClassId()); + // verify property "update" + UpdateInfo firstItemUpdate = firstItem.getUpdate(); + Assertions.assertNotNull(firstItemUpdate); + UpdateId firstItemUpdateUpdateId = firstItemUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemUpdateUpdateId); + Assertions.assertEquals("provider1", firstItemUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", firstItemUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", firstItemUpdateUpdateId.getVersion()); + // verify property "deviceCount" + Assertions.assertEquals(100, firstItem.getDeviceCount()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..4cc7e35cac8d --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListDeploymentsForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeploymentsForDeviceClassSubgroupTests() { + // method invocation + PagedIterable response + = deviceManagementClient.listDeploymentsForDeviceClassSubgroup("TestGroup", "deviceClassId1"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Deployment firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "deploymentId" + Assertions.assertEquals("deploymentId1", firstItem.getDeploymentId()); + // verify property "startDateTime" + Assertions.assertNotNull(firstItem.getStartDateTime()); + // verify property "update" + UpdateInfo firstItemUpdate = firstItem.getUpdate(); + Assertions.assertNotNull(firstItemUpdate); + UpdateId firstItemUpdateUpdateId = firstItemUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemUpdateUpdateId); + Assertions.assertEquals("provider1", firstItemUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", firstItemUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", firstItemUpdateUpdateId.getVersion()); + // verify property "groupId" + Assertions.assertEquals("TestGroup", firstItem.getGroupId()); + // verify property "isCanceled" + Assertions.assertEquals(false, firstItem.isCanceled()); + // verify property "isRetried" + Assertions.assertEquals(false, firstItem.isRetried()); + // verify property "rollbackPolicy" + CloudInitiatedRollbackPolicy firstItemRollbackPolicy = firstItem.getRollbackPolicy(); + Assertions.assertNotNull(firstItemRollbackPolicy); + UpdateInfo firstItemRollbackPolicyUpdate = firstItemRollbackPolicy.getUpdate(); + Assertions.assertNotNull(firstItemRollbackPolicyUpdate); + UpdateId firstItemRollbackPolicyUpdateUpdateId = firstItemRollbackPolicyUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemRollbackPolicyUpdateUpdateId); + Assertions.assertEquals("provider1", firstItemRollbackPolicyUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", firstItemRollbackPolicyUpdateUpdateId.getName()); + Assertions.assertEquals("0.9.0", firstItemRollbackPolicyUpdateUpdateId.getVersion()); + CloudInitiatedRollbackPolicyFailure firstItemRollbackPolicyFailure = firstItemRollbackPolicy.getFailure(); + Assertions.assertNotNull(firstItemRollbackPolicyFailure); + Assertions.assertEquals(50, firstItemRollbackPolicyFailure.getDevicesFailedPercentage()); + Assertions.assertEquals(100, firstItemRollbackPolicyFailure.getDevicesFailedCount()); + // verify property "isCloudInitiatedRollback" + Assertions.assertEquals(false, firstItem.isCloudInitiatedRollback()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java new file mode 100644 index 000000000000..e011143bdda0 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicy; +import com.azure.iot.deviceupdate.models.CloudInitiatedRollbackPolicyFailure; +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListDeploymentsForGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeploymentsForGroupTests() { + // method invocation + PagedIterable response = deviceManagementClient.listDeploymentsForGroup("TestGroup"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Deployment firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "deploymentId" + Assertions.assertEquals("deploymentId1", firstItem.getDeploymentId()); + // verify property "startDateTime" + Assertions.assertNotNull(firstItem.getStartDateTime()); + // verify property "update" + UpdateInfo firstItemUpdate = firstItem.getUpdate(); + Assertions.assertNotNull(firstItemUpdate); + UpdateId firstItemUpdateUpdateId = firstItemUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemUpdateUpdateId); + Assertions.assertEquals("provider1", firstItemUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", firstItemUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", firstItemUpdateUpdateId.getVersion()); + Assertions.assertEquals("Provider1 Name1 2022 Update", firstItemUpdate.getFriendlyName()); + // verify property "groupId" + Assertions.assertEquals("TestGroup", firstItem.getGroupId()); + // verify property "deviceClassSubgroups" + List firstItemDeviceClassSubgroups = firstItem.getDeviceClassSubgroups(); + Assertions.assertEquals("deviceClassId1", firstItemDeviceClassSubgroups.iterator().next()); + // verify property "isCanceled" + Assertions.assertEquals(false, firstItem.isCanceled()); + // verify property "isRetried" + Assertions.assertEquals(false, firstItem.isRetried()); + // verify property "rollbackPolicy" + CloudInitiatedRollbackPolicy firstItemRollbackPolicy = firstItem.getRollbackPolicy(); + Assertions.assertNotNull(firstItemRollbackPolicy); + UpdateInfo firstItemRollbackPolicyUpdate = firstItemRollbackPolicy.getUpdate(); + Assertions.assertNotNull(firstItemRollbackPolicyUpdate); + UpdateId firstItemRollbackPolicyUpdateUpdateId = firstItemRollbackPolicyUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemRollbackPolicyUpdateUpdateId); + Assertions.assertEquals("provider1", firstItemRollbackPolicyUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", firstItemRollbackPolicyUpdateUpdateId.getName()); + Assertions.assertEquals("0.9.0", firstItemRollbackPolicyUpdateUpdateId.getVersion()); + Assertions.assertEquals("Provider1 Name1 2022 Update", firstItemRollbackPolicyUpdate.getFriendlyName()); + CloudInitiatedRollbackPolicyFailure firstItemRollbackPolicyFailure = firstItemRollbackPolicy.getFailure(); + Assertions.assertNotNull(firstItemRollbackPolicyFailure); + Assertions.assertEquals(50, firstItemRollbackPolicyFailure.getDevicesFailedPercentage()); + Assertions.assertEquals(100, firstItemRollbackPolicyFailure.getDevicesFailedCount()); + // verify property "isCloudInitiatedRollback" + Assertions.assertEquals(false, firstItem.isCloudInitiatedRollback()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java new file mode 100644 index 000000000000..be0d8acec398 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.DeviceClassSubgroup; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListDeviceClassSubgroupsForGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeviceClassSubgroupsForGroupTests() { + // method invocation + PagedIterable response = deviceManagementClient.listDeviceClassSubgroupsForGroup("group1"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DeviceClassSubgroup firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "deviceClassId" + Assertions.assertEquals("DeviceClassId", firstItem.getDeviceClassId()); + // verify property "groupId" + Assertions.assertEquals("group1", firstItem.getGroupId()); + // verify property "createdDateTime" + Assertions.assertEquals("2020-07-01T12:13:14Z", firstItem.getCreatedDateTime()); + // verify property "deviceCount" + Assertions.assertEquals(149, firstItem.getDeviceCount()); + // verify property "deploymentId" + Assertions.assertEquals("MyDeployment", firstItem.getDeploymentId()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java new file mode 100644 index 000000000000..9b40b3d71ddb --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.ContractModel; +import com.azure.iot.deviceupdate.models.DeviceClass; +import com.azure.iot.deviceupdate.models.DeviceClassProperties; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListDeviceClassesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeviceClassesTests() { + // method invocation + PagedIterable response = deviceManagementClient.listDeviceClasses(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DeviceClass firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId", firstItem.getDeviceClassId()); + // verify property "friendlyName" + Assertions.assertEquals("DeviceClass2020-04-22T12:12:12.0000000+00:00", firstItem.getFriendlyName()); + // verify property "deviceClassProperties" + DeviceClassProperties firstItemDeviceClassProperties = firstItem.getDeviceClassProperties(); + Assertions.assertNotNull(firstItemDeviceClassProperties); + ContractModel firstItemDeviceClassPropertiesContractModel = firstItemDeviceClassProperties.getContractModel(); + Assertions.assertNotNull(firstItemDeviceClassPropertiesContractModel); + Assertions.assertEquals("dtmi:azure:iot:deviceUpdateContractModel;2", + firstItemDeviceClassPropertiesContractModel.getId()); + Assertions.assertEquals("Device Update Model V2", firstItemDeviceClassPropertiesContractModel.getName()); + Assertions.assertNotNull(firstItemDeviceClassProperties.getCompatProperties()); + // verify property "bestCompatibleUpdate" + UpdateInfo firstItemBestCompatibleUpdate = firstItem.getBestCompatibleUpdate(); + Assertions.assertNotNull(firstItemBestCompatibleUpdate); + UpdateId firstItemBestCompatibleUpdateUpdateId = firstItemBestCompatibleUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemBestCompatibleUpdateUpdateId); + Assertions.assertEquals("provider", firstItemBestCompatibleUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", firstItemBestCompatibleUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", firstItemBestCompatibleUpdateUpdateId.getVersion()); + Assertions.assertEquals("July 2022 Update", firstItemBestCompatibleUpdate.getFriendlyName()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests.java new file mode 100644 index 000000000000..95c7b7a905a6 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.DeploymentDeviceState; +import com.azure.iot.deviceupdate.models.DeviceDeploymentState; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests + extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests() { + // method invocation + PagedIterable response = deviceManagementClient + .listDeviceStatesForDeviceClassSubgroupDeployment("TestGroup", "deviceClassId", "deploymentId"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DeploymentDeviceState firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "deviceId" + Assertions.assertEquals("deviceId1", firstItem.getDeviceId()); + // verify property "retryCount" + Assertions.assertEquals(1, firstItem.getRetryCount()); + // verify property "movedOnToNewDeployment" + Assertions.assertEquals(false, firstItem.isMovedOnToNewDeployment()); + // verify property "deviceState" + Assertions.assertEquals(DeviceDeploymentState.SUCCEEDED, firstItem.getDeviceState()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevicesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevicesTests.java new file mode 100644 index 000000000000..456370bab8ca --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevicesTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.Device; +import com.azure.iot.deviceupdate.models.DeviceDeploymentState; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListDevicesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDevicesTests() { + // method invocation + PagedIterable response = deviceManagementClient.listDevices(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Device firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "deviceId" + Assertions.assertEquals("device1", firstItem.getDeviceId()); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId1", firstItem.getDeviceClassId()); + // verify property "lastAttemptedUpdate" + UpdateInfo firstItemLastAttemptedUpdate = firstItem.getLastAttemptedUpdate(); + Assertions.assertNotNull(firstItemLastAttemptedUpdate); + UpdateId firstItemLastAttemptedUpdateUpdateId = firstItemLastAttemptedUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemLastAttemptedUpdateUpdateId); + Assertions.assertEquals("provider1", firstItemLastAttemptedUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", firstItemLastAttemptedUpdateUpdateId.getName()); + Assertions.assertEquals("2.0.0.0", firstItemLastAttemptedUpdateUpdateId.getVersion()); + // verify property "deploymentStatus" + Assertions.assertEquals(DeviceDeploymentState.FAILED, firstItem.getDeploymentStatus()); + // verify property "installedUpdate" + UpdateInfo firstItemInstalledUpdate = firstItem.getInstalledUpdate(); + Assertions.assertNotNull(firstItemInstalledUpdate); + UpdateId firstItemInstalledUpdateUpdateId = firstItemInstalledUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemInstalledUpdateUpdateId); + Assertions.assertEquals("provider1", firstItemInstalledUpdateUpdateId.getProvider()); + Assertions.assertEquals("name1", firstItemInstalledUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", firstItemInstalledUpdateUpdateId.getVersion()); + // verify property "onLatestUpdate" + Assertions.assertEquals(false, firstItem.isOnLatestUpdate()); + // verify property "lastDeploymentId" + Assertions.assertEquals("myDeployment123", firstItem.getLastDeploymentId()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroupsTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroupsTests.java new file mode 100644 index 000000000000..3a96a16c30f3 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroupsTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.Group; +import com.azure.iot.deviceupdate.models.GroupType; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListGroupsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListGroupsTests() { + // method invocation + PagedIterable response = deviceManagementClient.listGroups(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Group firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "groupId" + Assertions.assertEquals("MyGroup1", firstItem.getGroupId()); + // verify property "groupType" + Assertions.assertEquals(GroupType.IO_THUB_TAG, firstItem.getGroupType()); + // verify property "createdDateTime" + Assertions.assertEquals("2020-07-01T12:13:14Z", firstItem.getCreatedDateTime()); + // verify property "deviceCount" + Assertions.assertEquals(100, firstItem.getDeviceCount()); + // verify property "subgroupsWithNewUpdatesAvailableCount" + Assertions.assertEquals(2, firstItem.getSubgroupsWithNewUpdatesAvailableCount()); + // verify property "subgroupsWithUpdatesInProgressCount" + Assertions.assertEquals(0, firstItem.getSubgroupsWithUpdatesInProgressCount()); + // verify property "subgroupsWithOnLatestUpdateCount" + Assertions.assertEquals(1, firstItem.getSubgroupsWithOnLatestUpdateCount()); + // verify property "deployments" + List firstItemDeployments = firstItem.getDeployments(); + Assertions.assertEquals("deployment1", firstItemDeployments.iterator().next()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevicesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevicesTests.java new file mode 100644 index 000000000000..b71d34ab674f --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevicesTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.DeviceHealth; +import com.azure.iot.deviceupdate.models.DeviceHealthState; +import com.azure.iot.deviceupdate.models.HealthCheck; +import com.azure.iot.deviceupdate.models.HealthCheckResult; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListHealthOfDevicesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListHealthOfDevicesTests() { + // method invocation + PagedIterable response = deviceManagementClient.listHealthOfDevices("state eq 'unhealthy'"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DeviceHealth firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "deviceId" + Assertions.assertEquals("device1", firstItem.getDeviceId()); + // verify property "moduleId" + Assertions.assertEquals("module1", firstItem.getModuleId()); + // verify property "state" + Assertions.assertEquals(DeviceHealthState.UNHEALTHY, firstItem.getState()); + // verify property "digitalTwinModelId" + Assertions.assertEquals("dtmi:foo;1", firstItem.getDigitalTwinModelId()); + // verify property "healthChecks" + List firstItemHealthChecks = firstItem.getHealthChecks(); + HealthCheck firstItemHealthChecksFirstItem = firstItemHealthChecks.iterator().next(); + Assertions.assertNotNull(firstItemHealthChecksFirstItem); + Assertions.assertEquals("check1", firstItemHealthChecksFirstItem.getName()); + Assertions.assertEquals(HealthCheckResult.SUCCESS, firstItemHealthChecksFirstItem.getResult()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java new file mode 100644 index 000000000000..841ad9135518 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListInstallableUpdatesForDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListInstallableUpdatesForDeviceClassTests() { + // method invocation + PagedIterable response + = deviceManagementClient.listInstallableUpdatesForDeviceClass("deviceClassId"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + UpdateInfo firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "updateId" + UpdateId firstItemUpdateId = firstItem.getUpdateId(); + Assertions.assertNotNull(firstItemUpdateId); + Assertions.assertEquals("provider", firstItemUpdateId.getProvider()); + Assertions.assertEquals("name", firstItemUpdateId.getName()); + Assertions.assertEquals("1.2.3.4", firstItemUpdateId.getVersion()); + // verify property "friendlyName" + Assertions.assertEquals("July 2022 Update", firstItem.getFriendlyName()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollectionsTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollectionsTests.java new file mode 100644 index 000000000000..77f00812715c --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollectionsTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.DeviceUpdateAgentId; +import com.azure.iot.deviceupdate.models.LogCollection; +import com.azure.iot.deviceupdate.models.OperationStatus; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListLogCollectionsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListLogCollectionsTests() { + // method invocation + PagedIterable response = deviceManagementClient.listLogCollections(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + LogCollection firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "logCollectionId" + Assertions.assertEquals("LogCollectionId", firstItem.getLogCollectionId()); + // verify property "deviceList" + List firstItemDeviceList = firstItem.getDeviceList(); + DeviceUpdateAgentId firstItemDeviceListFirstItem = firstItemDeviceList.iterator().next(); + Assertions.assertNotNull(firstItemDeviceListFirstItem); + Assertions.assertEquals("DeviceA", firstItemDeviceListFirstItem.getDeviceId()); + // verify property "description" + Assertions.assertEquals("Log collection description", firstItem.getDescription()); + // verify property "createdDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", firstItem.getCreatedDateTime()); + // verify property "lastActionDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", firstItem.getLastActionDateTime()); + // verify property "status" + Assertions.assertEquals(OperationStatus.NOT_STARTED, firstItem.getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatusesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatusesTests.java new file mode 100644 index 000000000000..a785d5e443e6 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatusesTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.DeviceOperation; +import com.azure.iot.deviceupdate.models.OperationStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementListOperationStatusesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListOperationStatusesTests() { + // method invocation + PagedIterable response = deviceManagementClient.listOperationStatuses(null, null); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + DeviceOperation firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "operationId" + Assertions.assertEquals("e4491c54-916f-443d-9094-bcca546ace2f", firstItem.getOperationId()); + // verify property "status" + Assertions.assertEquals(OperationStatus.SUCCEEDED, firstItem.getStatus()); + // verify property "traceId" + Assertions.assertEquals("2b881ef9deaf5d45b0a716ca5b4145ec", firstItem.getTraceId()); + // verify property "lastActionDateTime" + Assertions.assertNotNull(firstItem.getLastActionDateTime()); + // verify property "createdDateTime" + Assertions.assertNotNull(firstItem.getCreatedDateTime()); + // verify property "etag" + Assertions.assertEquals("\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\"", firstItem.getEtag()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementRetryDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementRetryDeploymentTests.java new file mode 100644 index 000000000000..b2b86a614017 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementRetryDeploymentTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementRetryDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementRetryDeploymentTests() { + // method invocation + Deployment response = deviceManagementClient.retryDeployment("TestGroup", "deviceClassId", "deploymentId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deploymentId" + Assertions.assertEquals("deploymentId", response.getDeploymentId()); + // verify property "startDateTime" + Assertions.assertNotNull(response.getStartDateTime()); + // verify property "update" + UpdateInfo responseUpdate = response.getUpdate(); + Assertions.assertNotNull(responseUpdate); + UpdateId responseUpdateUpdateId = responseUpdate.getUpdateId(); + Assertions.assertNotNull(responseUpdateUpdateId); + Assertions.assertEquals("provider", responseUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.4", responseUpdateUpdateId.getVersion()); + // verify property "groupId" + Assertions.assertEquals("TestGroup", response.getGroupId()); + // verify property "isCanceled" + Assertions.assertEquals(false, response.isCanceled()); + // verify property "isRetried" + Assertions.assertEquals(true, response.isRetried()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollectionTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollectionTests.java new file mode 100644 index 000000000000..96784229ef79 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollectionTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.DeviceUpdateAgentId; +import com.azure.iot.deviceupdate.models.LogCollection; +import com.azure.iot.deviceupdate.models.OperationStatus; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementStartLogCollectionTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementStartLogCollectionTests() { + // method invocation + LogCollection response = deviceManagementClient.startLogCollection("LogCollectionId", + new LogCollection(Arrays.asList(new DeviceUpdateAgentId("DeviceA"), + new DeviceUpdateAgentId("DeviceB").setModuleId("ModuleB"))) + .setDescription("Log collection description")); + + // response assertion + Assertions.assertNotNull(response); + // verify property "logCollectionId" + Assertions.assertEquals("LogCollectionId", response.getLogCollectionId()); + // verify property "deviceList" + List responseDeviceList = response.getDeviceList(); + DeviceUpdateAgentId responseDeviceListFirstItem = responseDeviceList.iterator().next(); + Assertions.assertNotNull(responseDeviceListFirstItem); + Assertions.assertEquals("DeviceA", responseDeviceListFirstItem.getDeviceId()); + // verify property "description" + Assertions.assertEquals("og collection description", response.getDescription()); + // verify property "createdDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", response.getCreatedDateTime()); + // verify property "lastActionDateTime" + Assertions.assertEquals("2021-09-30T02:23:41.59Z", response.getLastActionDateTime()); + // verify property "status" + Assertions.assertEquals(OperationStatus.NOT_STARTED, response.getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStopDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStopDeploymentTests.java new file mode 100644 index 000000000000..ba111ecea07a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStopDeploymentTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.Deployment; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementStopDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementStopDeploymentTests() { + // method invocation + Deployment response = deviceManagementClient.stopDeployment("TestGroup", "deviceClassId", "deploymentId"); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deploymentId" + Assertions.assertEquals("deploymentId", response.getDeploymentId()); + // verify property "startDateTime" + Assertions.assertNotNull(response.getStartDateTime()); + // verify property "update" + UpdateInfo responseUpdate = response.getUpdate(); + Assertions.assertNotNull(responseUpdate); + UpdateId responseUpdateUpdateId = responseUpdate.getUpdateId(); + Assertions.assertNotNull(responseUpdateUpdateId); + Assertions.assertEquals("provider", responseUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseUpdateUpdateId.getName()); + Assertions.assertEquals("1.2.3.4", responseUpdateUpdateId.getVersion()); + // verify property "groupId" + Assertions.assertEquals("TestGroup", response.getGroupId()); + // verify property "isCanceled" + Assertions.assertEquals(true, response.isCanceled()); + // verify property "isRetried" + Assertions.assertEquals(false, response.isRetried()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java new file mode 100644 index 000000000000..dab96a48af9d --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.ContractModel; +import com.azure.iot.deviceupdate.models.DeviceClass; +import com.azure.iot.deviceupdate.models.DeviceClassProperties; +import com.azure.iot.deviceupdate.models.PatchBody; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceManagementUpdateDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementUpdateDeviceClassTests() { + // method invocation + DeviceClass response + = deviceManagementClient.updateDeviceClass("deviceClassId", new PatchBody().setFriendlyName("GA Webcams")); + + // response assertion + Assertions.assertNotNull(response); + // verify property "deviceClassId" + Assertions.assertEquals("deviceClassId", response.getDeviceClassId()); + // verify property "friendlyName" + Assertions.assertEquals("GA Webcams", response.getFriendlyName()); + // verify property "deviceClassProperties" + DeviceClassProperties responseDeviceClassProperties = response.getDeviceClassProperties(); + Assertions.assertNotNull(responseDeviceClassProperties); + ContractModel responseDeviceClassPropertiesContractModel = responseDeviceClassProperties.getContractModel(); + Assertions.assertNotNull(responseDeviceClassPropertiesContractModel); + Assertions.assertEquals("dtmi:azure:iot:deviceUpdateContractModel;2", + responseDeviceClassPropertiesContractModel.getId()); + Assertions.assertEquals("Device Update Model V2", responseDeviceClassPropertiesContractModel.getName()); + Assertions.assertNotNull(responseDeviceClassProperties.getCompatProperties()); + // verify property "bestCompatibleUpdate" + UpdateInfo responseBestCompatibleUpdate = response.getBestCompatibleUpdate(); + Assertions.assertNotNull(responseBestCompatibleUpdate); + UpdateId responseBestCompatibleUpdateUpdateId = responseBestCompatibleUpdate.getUpdateId(); + Assertions.assertNotNull(responseBestCompatibleUpdateUpdateId); + Assertions.assertEquals("provider", responseBestCompatibleUpdateUpdateId.getProvider()); + Assertions.assertEquals("name", responseBestCompatibleUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", responseBestCompatibleUpdateUpdateId.getVersion()); + Assertions.assertEquals("July 2022 Update", responseBestCompatibleUpdate.getFriendlyName()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateClientTestBase.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateClientTestBase.java new file mode 100644 index 000000000000..3528c94bd58a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateClientTestBase.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.iot.deviceupdate.DeviceManagementClient; +import com.azure.iot.deviceupdate.DeviceUpdateClient; +import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; + +class DeviceUpdateClientTestBase extends TestProxyTestBase { + protected DeviceUpdateClient deviceUpdateClient; + + protected DeviceManagementClient deviceManagementClient; + + @Override + protected void beforeTest() { + DeviceUpdateClientBuilder deviceUpdateClientbuilder = new DeviceUpdateClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .instanceId(Configuration.getGlobalConfiguration().get("INSTANCEID", "instanceid")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + deviceUpdateClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + deviceUpdateClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + deviceUpdateClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + deviceUpdateClient = deviceUpdateClientbuilder.buildDeviceUpdateClient(); + + DeviceUpdateClientBuilder deviceManagementClientbuilder = new DeviceUpdateClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .instanceId(Configuration.getGlobalConfiguration().get("INSTANCEID", "instanceid")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + deviceManagementClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + deviceManagementClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + deviceManagementClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + deviceManagementClient = deviceManagementClientbuilder.buildDeviceManagementClient(); + + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java new file mode 100644 index 000000000000..cef692520b20 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.iot.deviceupdate.models.UpdateOperation; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateDeleteUpdateTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateDeleteUpdateTests() { + // method invocation + SyncPoller response + = setPlaybackSyncPollerPollInterval(deviceUpdateClient.beginDeleteUpdate("microsoft", "adu", "1.0.0.0")); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFileTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFileTests.java new file mode 100644 index 000000000000..d58294b1fb60 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFileTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.UpdateFile; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateGetFileTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateGetFileTests() { + // method invocation + UpdateFile response = deviceUpdateClient.getFile("microsoft", "adu", "1.0.0.0", "abc123", null); + + // response assertion + Assertions.assertNotNull(response); + // verify property "fileId" + Assertions.assertEquals("abc123", response.getFileId()); + // verify property "etag" + Assertions.assertEquals("\"26bd8eba-4bb2-4960-a357-ca4d60b5fb4b\"", response.getEtag()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatusTests.java new file mode 100644 index 000000000000..19940accb4e7 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatusTests.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.OperationStatus; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import com.azure.iot.deviceupdate.models.UpdateOperation; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateGetOperationStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateGetOperationStatusTests() { + // method invocation + UpdateOperation response = deviceUpdateClient.getOperationStatus("e4491c54-916f-443d-9094-bcca546ace2f", null); + + // response assertion + Assertions.assertNotNull(response); + // verify property "operationId" + Assertions.assertEquals("e4491c54-916f-443d-9094-bcca546ace2f", response.getOperationId()); + // verify property "status" + Assertions.assertEquals(OperationStatus.SUCCEEDED, response.getStatus()); + // verify property "update" + UpdateInfo responseUpdate = response.getUpdate(); + Assertions.assertNotNull(responseUpdate); + UpdateId responseUpdateUpdateId = responseUpdate.getUpdateId(); + Assertions.assertNotNull(responseUpdateUpdateId); + Assertions.assertEquals("microsoft", responseUpdateUpdateId.getProvider()); + Assertions.assertEquals("adu", responseUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", responseUpdateUpdateId.getVersion()); + Assertions.assertEquals("Microsoft ADU v1", responseUpdate.getFriendlyName()); + // verify property "resourceLocation" + Assertions.assertEquals( + "/deviceUpdate/blue/updates/providers/microsoft/names/adu/versions/1.0.0.0?api-version=2026-06-01", + response.getResourceLocation()); + // verify property "traceId" + Assertions.assertEquals("2b881ef9deaf5d45b0a716ca5b4145ec", response.getTraceId()); + // verify property "lastActionDateTime" + Assertions.assertNotNull(response.getLastActionDateTime()); + // verify property "createdDateTime" + Assertions.assertNotNull(response.getCreatedDateTime()); + // verify property "etag" + Assertions.assertEquals("\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\"", response.getEtag()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdateTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdateTests.java new file mode 100644 index 000000000000..12ceeb4e3b2a --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdateTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.iot.deviceupdate.models.Compatibility; +import com.azure.iot.deviceupdate.models.Instructions; +import com.azure.iot.deviceupdate.models.Step; +import com.azure.iot.deviceupdate.models.Update; +import com.azure.iot.deviceupdate.models.UpdateId; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateGetUpdateTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateGetUpdateTests() { + // method invocation + Update response = deviceUpdateClient.getUpdate("microsoft", "adu", "1.0.0.0", null); + + // response assertion + Assertions.assertNotNull(response); + // verify property "updateId" + UpdateId responseUpdateId = response.getUpdateId(); + Assertions.assertNotNull(responseUpdateId); + Assertions.assertEquals("microsoft", responseUpdateId.getProvider()); + Assertions.assertEquals("adu", responseUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", responseUpdateId.getVersion()); + // verify property "description" + Assertions.assertEquals("Fix for critical vulnerability", response.getDescription()); + // verify property "friendlyName" + Assertions.assertEquals("Lab Sensor Update v1", response.getFriendlyName()); + // verify property "compatibility" + List responseCompatibility = response.getCompatibility(); + Compatibility responseCompatibilityFirstItem = responseCompatibility.iterator().next(); + Assertions.assertNotNull(responseCompatibilityFirstItem); + // verify property "instructions" + Instructions responseInstructions = response.getInstructions(); + Assertions.assertNotNull(responseInstructions); + List responseInstructionsSteps = responseInstructions.getSteps(); + Step responseInstructionsStepsFirstItem = responseInstructionsSteps.iterator().next(); + Assertions.assertNotNull(responseInstructionsStepsFirstItem); + Assertions.assertEquals("pre-install script", responseInstructionsStepsFirstItem.getDescription()); + Assertions.assertEquals("microsoft/script:1", responseInstructionsStepsFirstItem.getHandler()); + Assertions.assertNotNull(responseInstructionsStepsFirstItem.getHandlerProperties()); + List responseInstructionsStepsFirstItemFiles = responseInstructionsStepsFirstItem.getFiles(); + Assertions.assertEquals("configure.sh", responseInstructionsStepsFirstItemFiles.iterator().next()); + // verify property "manifestVersion" + Assertions.assertEquals("5.0", response.getManifestVersion()); + // verify property "importedDateTime" + Assertions.assertNotNull(response.getImportedDateTime()); + // verify property "createdDateTime" + Assertions.assertNotNull(response.getCreatedDateTime()); + // verify property "etag" + Assertions.assertEquals("\"3fed3378-0c67-47d2-b796-296962c66cbb\"", response.getEtag()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdateTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdateTests.java new file mode 100644 index 000000000000..d12a86c404cb --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdateTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import com.azure.iot.deviceupdate.models.FileImportMetadata; +import com.azure.iot.deviceupdate.models.ImportManifestMetadata; +import com.azure.iot.deviceupdate.models.ImportUpdateInputItem; +import com.azure.iot.deviceupdate.models.UpdateOperation; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateImportUpdateTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateImportUpdateTests() { + // method invocation + SyncPoller response = setPlaybackSyncPollerPollInterval( + deviceUpdateClient.beginImportUpdate(Arrays.asList(new ImportUpdateInputItem(new ImportManifestMetadata( + "http://test.blob.core.windows.net/test/uploadimportMan.json", 816L, + mapOf("sha256", "O19LyyncPe1AGstOdkcmozLV8pSbBdqrE18HdYVohRc="))).setFiles(Arrays.asList( + new FileImportMetadata("file1.bin", "http://test.blob.core.windows.net/test/upload1v5uww1q"), + new FileImportMetadata("file2.bin", "http://test.blob.core.windows.net/test/uploadkrmn5yw0"), + new FileImportMetadata("file3.bin", "http://test.blob.core.windows.net/test/uploaddq52ky5m")))))); + + // response assertion + Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, + response.waitForCompletion().getStatus()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFilesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFilesTests.java new file mode 100644 index 000000000000..6a491a7d40b1 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFilesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateListFilesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListFilesTests() { + // method invocation + PagedIterable response = deviceUpdateClient.listFiles("microsoft", "adu", "1.0.0.0"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNamesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNamesTests.java new file mode 100644 index 000000000000..a64a65b8b7f2 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNamesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateListNamesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListNamesTests() { + // method invocation + PagedIterable response = deviceUpdateClient.listNames("microsoft"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatusesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatusesTests.java new file mode 100644 index 000000000000..20766ae3228b --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatusesTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.OperationStatus; +import com.azure.iot.deviceupdate.models.UpdateId; +import com.azure.iot.deviceupdate.models.UpdateInfo; +import com.azure.iot.deviceupdate.models.UpdateOperation; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateListOperationStatusesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListOperationStatusesTests() { + // method invocation + PagedIterable response = deviceUpdateClient.listOperationStatuses(null, null); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + UpdateOperation firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "operationId" + Assertions.assertEquals("e4491c54-916f-443d-9094-bcca546ace2f", firstItem.getOperationId()); + // verify property "status" + Assertions.assertEquals(OperationStatus.SUCCEEDED, firstItem.getStatus()); + // verify property "update" + UpdateInfo firstItemUpdate = firstItem.getUpdate(); + Assertions.assertNotNull(firstItemUpdate); + UpdateId firstItemUpdateUpdateId = firstItemUpdate.getUpdateId(); + Assertions.assertNotNull(firstItemUpdateUpdateId); + Assertions.assertEquals("microsoft", firstItemUpdateUpdateId.getProvider()); + Assertions.assertEquals("adu", firstItemUpdateUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", firstItemUpdateUpdateId.getVersion()); + Assertions.assertEquals("Microsoft ADU v1", firstItemUpdate.getFriendlyName()); + // verify property "resourceLocation" + Assertions.assertEquals( + "/deviceUpdate/blue/updates/providers/microsoft/names/adu/versions/1.0.0.0?api-version=2026-06-01", + firstItem.getResourceLocation()); + // verify property "traceId" + Assertions.assertEquals("2b881ef9deaf5d45b0a716ca5b4145ec", firstItem.getTraceId()); + // verify property "lastActionDateTime" + Assertions.assertNotNull(firstItem.getLastActionDateTime()); + // verify property "createdDateTime" + Assertions.assertNotNull(firstItem.getCreatedDateTime()); + // verify property "etag" + Assertions.assertEquals("\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\"", firstItem.getEtag()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProvidersTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProvidersTests.java new file mode 100644 index 000000000000..e4f35bc2b7dd --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProvidersTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateListProvidersTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListProvidersTests() { + // method invocation + PagedIterable response = deviceUpdateClient.listProviders(); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdatesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdatesTests.java new file mode 100644 index 000000000000..19472a4e0d7f --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdatesTests.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.iot.deviceupdate.models.Compatibility; +import com.azure.iot.deviceupdate.models.Instructions; +import com.azure.iot.deviceupdate.models.Step; +import com.azure.iot.deviceupdate.models.Update; +import com.azure.iot.deviceupdate.models.UpdateId; +import java.util.List; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateListUpdatesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListUpdatesTests() { + // method invocation + PagedIterable response = deviceUpdateClient.listUpdates(null, null); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Update firstItem = response.iterator().next(); + Assertions.assertNotNull(firstItem); + // verify property "updateId" + UpdateId firstItemUpdateId = firstItem.getUpdateId(); + Assertions.assertNotNull(firstItemUpdateId); + Assertions.assertEquals("microsoft", firstItemUpdateId.getProvider()); + Assertions.assertEquals("adu", firstItemUpdateId.getName()); + Assertions.assertEquals("1.0.0.0", firstItemUpdateId.getVersion()); + // verify property "description" + Assertions.assertEquals("Example update.", firstItem.getDescription()); + // verify property "compatibility" + List firstItemCompatibility = firstItem.getCompatibility(); + Compatibility firstItemCompatibilityFirstItem = firstItemCompatibility.iterator().next(); + Assertions.assertNotNull(firstItemCompatibilityFirstItem); + // verify property "instructions" + Instructions firstItemInstructions = firstItem.getInstructions(); + Assertions.assertNotNull(firstItemInstructions); + List firstItemInstructionsSteps = firstItemInstructions.getSteps(); + Step firstItemInstructionsStepsFirstItem = firstItemInstructionsSteps.iterator().next(); + Assertions.assertNotNull(firstItemInstructionsStepsFirstItem); + Assertions.assertEquals("pre-install script", firstItemInstructionsStepsFirstItem.getDescription()); + Assertions.assertEquals("microsoft/script:1", firstItemInstructionsStepsFirstItem.getHandler()); + Assertions.assertNotNull(firstItemInstructionsStepsFirstItem.getHandlerProperties()); + List firstItemInstructionsStepsFirstItemFiles = firstItemInstructionsStepsFirstItem.getFiles(); + Assertions.assertEquals("configure.sh", firstItemInstructionsStepsFirstItemFiles.iterator().next()); + // verify property "manifestVersion" + Assertions.assertEquals("5.0", firstItem.getManifestVersion()); + // verify property "importedDateTime" + Assertions.assertNotNull(firstItem.getImportedDateTime()); + // verify property "createdDateTime" + Assertions.assertNotNull(firstItem.getCreatedDateTime()); + // verify property "etag" + Assertions.assertEquals("\"3fed3378-0c67-47d2-b796-296962c66cbb\"", firstItem.getEtag()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersionsTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersionsTests.java new file mode 100644 index 000000000000..f29da503f603 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersionsTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.iot.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public final class DeviceUpdateListVersionsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListVersionsTests() { + // method invocation + PagedIterable response = deviceUpdateClient.listVersions("microsoft", "adu"); + + // response assertion + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml new file mode 100644 index 000000000000..dfe6b1560ec3 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/deviceupdate/data-plane/duiothub +commit: 292231b1131ff9fd070377372a0647c6ac7a6ce2 +repo: Azure/azure-rest-api-specs +additionalDirectories: