diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md index e429c29ed32c..fb5a3bd9eb88 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md @@ -1,14 +1,252 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2026-07-08) ### Features Added -### Breaking Changes +* `models.StepType` was added -### Bugs Fixed +* `models.DeviceClass` was added -### Other Changes +* `models.OperationStatus` was added + +* `models.DeviceHealth` was added + +* `models.DeviceClassSubgroupDeploymentState` was added + +* `models.DeviceUpdateAgentId` was added + +* `models.UpdateId` was added + +* `models.DeviceClassSubgroupDeploymentStatus` was added + +* `models.Step` was added + +* `models.ImportType` was added + +* `models.LogCollectionOperationDetailedStatus` was added + +* `models.UpdateFile` was added + +* `models.DeviceDeploymentState` was added + +* `models.LogCollection` was added + +* `models.Error` was added + +* `models.PatchBody` was added + +* `models.UpdateOperation` was added + +* `models.Group` was added + +* `models.UpdateFileDownloadHandler` was added + +* `models.InstallResult` was added + +* `models.StepResult` was added + +* `models.DeploymentStatus` was added + +* `models.HealthCheck` was added + +* `models.FileImportMetadata` was added + +* `models.InnerError` was added + +* `models.GroupType` was added + +* `models.CloudInitiatedRollbackPolicyFailure` was added + +* `models.UpdateCompliance` was added + +* `models.Deployment` was added + +* `models.ImportUpdateInputItem` was added + +* `models.DownloadSecurity` was added + +* `models.UpdateFileBase` was added + +* `models.Device` was added + +* `models.DeviceOperation` was added + +* `models.UpdateInfo` was added + +* `models.DeploymentDeviceState` was added + +* `models.DeviceClassSubgroupUpdatableDevices` was added + +* `models.LogCollectionOperationDeviceStatus` was added + +* `models.HealthCheckResult` was added + +* `models.Update` was added + +* `models.DeviceHealthState` was added + +* `models.Instructions` was added + +* `models.Compatibility` was added + +* `models.DeviceClassSubgroup` was added + +* `models.ContractModel` was added + +* `models.CloudInitiatedRollbackPolicy` was added + +* `models.DeviceClassProperties` was added + +* `models.DeploymentState` was added + +* `models.ImportManifestMetadata` was added + +#### `DeviceUpdateClient` was modified + +* `getUpdate(java.lang.String,java.lang.String,java.lang.String)` was added +* `getOperationStatus(java.lang.String,java.lang.String)` was added +* `listUpdates()` was added +* `listFiles(java.lang.String,java.lang.String,java.lang.String)` was added +* `getOperationStatus(java.lang.String)` was added +* `listVersions(java.lang.String,java.lang.String,java.lang.String)` was added +* `listVersions(java.lang.String,java.lang.String)` was added +* `beginImportUpdate(java.util.List)` was added +* `getFile(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listNames(java.lang.String)` was added +* `beginDeleteUpdate(java.lang.String,java.lang.String,java.lang.String)` was added +* `getUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listOperationStatuses(java.lang.String,java.lang.Integer)` was added +* `listOperationStatuses()` was added +* `listUpdates(java.lang.String,java.lang.String)` was added +* `getFile(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listProviders()` was added + +#### `DeviceManagementAsyncClient` was modified + +* `getDeviceClassSubgroupDeploymentStatus(java.lang.String,java.lang.String,java.lang.String)` was added +* `getDeploymentForDeviceClassSubgroup(java.lang.String,java.lang.String,java.lang.String)` was added +* `listDeviceStatesForDeviceClassSubgroupDeployment(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `startLogCollection(java.lang.String,models.LogCollection)` was added +* `listDeviceClasses(java.lang.String)` was added +* `updateDeviceClass(java.lang.String,models.PatchBody)` was added +* `deleteGroup(java.lang.String)` was added +* `getDeviceModule(java.lang.String,java.lang.String)` was added +* `getUpdateComplianceForGroup(java.lang.String)` was added +* `getOperationStatus(java.lang.String)` was added +* `listBestUpdatesForGroup(java.lang.String)` was added +* `deleteDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `getBestUpdatesForDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `listDevices()` was added +* `getOperationStatus(java.lang.String,java.lang.String)` was added +* `listDeviceClassSubgroupsForGroup(java.lang.String,java.lang.String)` was added +* `listGroups()` was added +* `listDeploymentsForGroup(java.lang.String)` was added +* `getUpdateCompliance()` was added +* `listDeviceClasses()` was added +* `getGroup(java.lang.String)` was added +* `beginImportDevices(models.ImportType)` was added +* `listDeploymentsForGroup(java.lang.String,java.lang.String)` was added +* `deleteDeployment(java.lang.String,java.lang.String)` was added +* `listDeviceStatesForDeviceClassSubgroupDeployment(java.lang.String,java.lang.String,java.lang.String)` was added +* `listDeploymentsForDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `getDeployment(java.lang.String,java.lang.String)` was added +* `listHealthOfDevices(java.lang.String)` was added +* `listDeviceClassSubgroupsForGroup(java.lang.String)` was added +* `listOperationStatuses()` was added +* `retryDeployment(java.lang.String,java.lang.String,java.lang.String)` was added +* `listDevices(java.lang.String)` was added +* `listLogCollections()` was added +* `listInstallableUpdatesForDeviceClass(java.lang.String)` was added +* `getLogCollectionDetailedStatus(java.lang.String)` was added +* `listGroups(java.lang.String)` was added +* `getDevice(java.lang.String)` was added +* `listDeploymentsForDeviceClassSubgroup(java.lang.String,java.lang.String,java.lang.String)` was added +* `getDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `getLogCollection(java.lang.String)` was added +* `listOperationStatuses(java.lang.String,java.lang.Integer)` was added +* `getDeploymentStatus(java.lang.String,java.lang.String)` was added +* `getDeviceClass(java.lang.String)` was added +* `createOrUpdateDeployment(java.lang.String,java.lang.String,models.Deployment)` was added +* `getDeviceClassSubgroupUpdateCompliance(java.lang.String,java.lang.String)` was added +* `stopDeployment(java.lang.String,java.lang.String,java.lang.String)` was added +* `deleteDeploymentForDeviceClassSubgroup(java.lang.String,java.lang.String,java.lang.String)` was added +* `deleteDeviceClass(java.lang.String)` was added + +#### `DeviceManagementClient` was modified + +* `listDeploymentsForDeviceClassSubgroup(java.lang.String,java.lang.String,java.lang.String)` was added +* `listDeviceClasses(java.lang.String)` was added +* `listDeviceClassSubgroupsForGroup(java.lang.String)` was added +* `listLogCollections()` was added +* `listBestUpdatesForGroup(java.lang.String)` was added +* `getDeviceModule(java.lang.String,java.lang.String)` was added +* `getDevice(java.lang.String)` was added +* `listHealthOfDevices(java.lang.String)` was added +* `getLogCollectionDetailedStatus(java.lang.String)` was added +* `updateDeviceClass(java.lang.String,models.PatchBody)` was added +* `listDeploymentsForGroup(java.lang.String,java.lang.String)` was added +* `listDeviceStatesForDeviceClassSubgroupDeployment(java.lang.String,java.lang.String,java.lang.String)` was added +* `deleteDeploymentForDeviceClassSubgroup(java.lang.String,java.lang.String,java.lang.String)` was added +* `getUpdateComplianceForGroup(java.lang.String)` was added +* `deleteDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `retryDeployment(java.lang.String,java.lang.String,java.lang.String)` was added +* `deleteGroup(java.lang.String)` was added +* `stopDeployment(java.lang.String,java.lang.String,java.lang.String)` was added +* `getGroup(java.lang.String)` was added +* `getUpdateCompliance()` was added +* `listDevices(java.lang.String)` was added +* `listInstallableUpdatesForDeviceClass(java.lang.String)` was added +* `listDeviceClassSubgroupsForGroup(java.lang.String,java.lang.String)` was added +* `listOperationStatuses()` was added +* `getBestUpdatesForDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `createOrUpdateDeployment(java.lang.String,java.lang.String,models.Deployment)` was added +* `listDevices()` was added +* `getDeploymentStatus(java.lang.String,java.lang.String)` was added +* `listDeploymentsForGroup(java.lang.String)` was added +* `listGroups()` was added +* `getDeployment(java.lang.String,java.lang.String)` was added +* `getDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `deleteDeviceClass(java.lang.String)` was added +* `getDeviceClassSubgroupUpdateCompliance(java.lang.String,java.lang.String)` was added +* `startLogCollection(java.lang.String,models.LogCollection)` was added +* `listOperationStatuses(java.lang.String,java.lang.Integer)` was added +* `deleteDeployment(java.lang.String,java.lang.String)` was added +* `listDeploymentsForDeviceClassSubgroup(java.lang.String,java.lang.String)` was added +* `getDeviceClassSubgroupDeploymentStatus(java.lang.String,java.lang.String,java.lang.String)` was added +* `beginImportDevices(models.ImportType)` was added +* `getOperationStatus(java.lang.String,java.lang.String)` was added +* `getOperationStatus(java.lang.String)` was added +* `listDeviceStatesForDeviceClassSubgroupDeployment(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `getLogCollection(java.lang.String)` was added +* `listGroups(java.lang.String)` was added +* `getDeploymentForDeviceClassSubgroup(java.lang.String,java.lang.String,java.lang.String)` was added +* `listDeviceClasses()` was added +* `getDeviceClass(java.lang.String)` was added + +#### `DeviceUpdateServiceVersion` was modified + +* `V2026_06_01` was added + +#### `DeviceUpdateAsyncClient` was modified + +* `beginDeleteUpdate(java.lang.String,java.lang.String,java.lang.String)` was added +* `getOperationStatus(java.lang.String)` was added +* `getUpdate(java.lang.String,java.lang.String,java.lang.String)` was added +* `listProviders()` was added +* `listFiles(java.lang.String,java.lang.String,java.lang.String)` was added +* `listVersions(java.lang.String,java.lang.String,java.lang.String)` was added +* `getFile(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `getUpdate(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listOperationStatuses(java.lang.String,java.lang.Integer)` was added +* `listNames(java.lang.String)` was added +* `listOperationStatuses()` was added +* `beginImportUpdate(java.util.List)` was added +* `listUpdates()` was added +* `listVersions(java.lang.String,java.lang.String)` was added +* `getOperationStatus(java.lang.String,java.lang.String)` was added +* `getFile(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added +* `listUpdates(java.lang.String,java.lang.String)` was added ## 1.0.33 (2026-05-05) diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/assets.json b/sdk/deviceupdate/azure-iot-deviceupdate/assets.json index 0d79c9c10a09..e3e253f3106a 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/assets.json +++ b/sdk/deviceupdate/azure-iot-deviceupdate/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/deviceupdate/azure-iot-deviceupdate", - "Tag": "java/deviceupdate/azure-iot-deviceupdate_e6c0b7421b" + "Tag": "java/deviceupdate/azure-iot-deviceupdate_4a925a77df" } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/customization/src/main/java/DeviceUpdateCustomization.java b/sdk/deviceupdate/azure-iot-deviceupdate/customization/src/main/java/DeviceUpdateCustomization.java new file mode 100644 index 000000000000..808e7e3a85f1 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/customization/src/main/java/DeviceUpdateCustomization.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import com.azure.autorest.customization.ClassCustomization; +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.github.javaparser.StaticJavaParser; +import org.slf4j.Logger; + +/** + * Customization that preserves backward compatibility of the {@code beginDeleteUpdate} long-running + * operation's protocol overloads. + * + *

The prior GA library ({@code azure-iot-deviceupdate} 1.0.x) shipped these protocol LRO overloads + * with a final-result type of {@code BinaryData}. After migrating to TypeSpec, the emitter derives the + * final-result type as {@code Void} (the delete operation has an empty {@code 204} response), which is a + * binary breaking change: {@code SyncPoller} became {@code SyncPoller} + * (and the async {@code PollerFlux} equivalent).

+ * + *

This cannot be expressed in {@code client.tsp}/{@code tspconfig.yaml}, so this customization restores the + * final-result type to {@code BinaryData} on the public sync/async clients and on the underlying implementation + * client (both the method return type and the poller's final-result {@link com.azure.core.util.serializer.TypeReference}).

+ */ +public class DeviceUpdateCustomization extends Customization { + + private static final String ROOT_PACKAGE = "com.azure.iot.deviceupdate"; + private static final String IMPL_PACKAGE = "com.azure.iot.deviceupdate.implementation"; + + @Override + public void customize(LibraryCustomization libraryCustomization, Logger logger) { + logger.info("Restoring 'beginDeleteUpdate' protocol overload final-result type to BinaryData for backward compatibility."); + + // Public clients: only the method return type needs to change; the body simply delegates to the + // implementation client, whose return type is retyped below. + restoreBinaryDataFinalResult(libraryCustomization.getClass(ROOT_PACKAGE, "DeviceUpdateClient"), + "beginDeleteUpdate", false); + restoreBinaryDataFinalResult(libraryCustomization.getClass(ROOT_PACKAGE, "DeviceUpdateAsyncClient"), + "beginDeleteUpdate", false); + + // Implementation client: retype the method and rewrite the poller's final-result TypeReference. + ClassCustomization impl = libraryCustomization.getClass(IMPL_PACKAGE, "DeviceUpdateClientImpl"); + restoreBinaryDataFinalResult(impl, "beginDeleteUpdate", true); + restoreBinaryDataFinalResult(impl, "beginDeleteUpdateAsync", true); + } + + /** + * Retypes the protocol overload of {@code methodName} from {@code } back to + * {@code }. Only the protocol overload (whose return type is exactly + * {@code SyncPoller} or {@code PollerFlux}) is affected; the model + * convenience overloads ({@code }) are left untouched. + * + * @param classCustomization the class to customize. + * @param methodName the method name to retype. + * @param rewriteFinalResultTypeReference when {@code true}, also rewrites + * {@code TypeReference.createInstance(Void.class)} to {@code TypeReference.createInstance(BinaryData.class)} + * in the method body (needed for the implementation client that constructs the poller). + */ + private static void restoreBinaryDataFinalResult(ClassCustomization classCustomization, String methodName, + boolean rewriteFinalResultTypeReference) { + classCustomization.customizeAst(ast -> ast.getClassByName(classCustomization.getClassName()) + .ifPresent(clazz -> clazz.getMethodsByName(methodName).forEach(method -> { + String returnType = method.getTypeAsString().replace(" ", ""); + if (!returnType.equals("SyncPoller") + && !returnType.equals("PollerFlux")) { + return; + } + + method.setType(StaticJavaParser.parseType(method.getTypeAsString().replace("Void", "BinaryData"))); + + if (rewriteFinalResultTypeReference) { + method.getBody().ifPresent(body -> method.setBody(StaticJavaParser.parseBlock( + body.toString().replace("TypeReference.createInstance(Void.class)", + "TypeReference.createInstance(BinaryData.class)")))); + } + }))); + } +} 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..ae5a003e09b2 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,85 +12,107 @@ 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.DeviceManagementClientImpl; +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. */ +/** + * Initializes a new instance of the asynchronous DeviceManagementClient type. + */ @ServiceClient(builder = DeviceManagementClientBuilder.class, isAsync = true) public final class DeviceManagementAsyncClient { @Generated - private final DeviceManagementsImpl serviceClient; + private final DeviceManagementClientImpl serviceClient; /** * Initializes an instance of DeviceManagementAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated - DeviceManagementAsyncClient(DeviceManagementsImpl serviceClient) { + DeviceManagementAsyncClient(DeviceManagementClientImpl serviceClient) { this.serviceClient = serviceClient; } /** - * 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. @@ -870,7 +899,7 @@ 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. @@ -888,12 +917,12 @@ public Mono> deleteDeploymentWithResponse(String groupId, String } /** - * 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 +955,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 +965,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 +977,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 +1019,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 +1033,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 +1053,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 +1079,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 +1102,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 +1115,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 +1135,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 +1145,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 +1158,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 +1219,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 +1249,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. @@ -1240,7 +1274,7 @@ public Mono> getDeploymentForDeviceClassSubgroupWithRespons /** * Deletes a device class subgroup deployment. - * + * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1261,10 +1295,10 @@ public Mono> deleteDeploymentForDeviceClassSubgroupWithResponse(S /** * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1291,9 +1325,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 +1349,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 +1379,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 +1403,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 +1434,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 +1445,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 +1458,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 +1503,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 +1539,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 +1558,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 +1618,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 +1635,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 +1655,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 +1676,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 +1693,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 +1714,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 +1749,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 +1770,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 +1790,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 +1823,1388 @@ public Mono> getLogCollectionDetailedStatusWithResponse(Str public PagedFlux listHealthOfDevices(String filter, RequestOptions requestOptions) { return this.serviceClient.listHealthOfDevicesAsync(filter, 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)); + } + + /** + * 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); + } + + /** + * 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)); + } + + /** + * 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); + } + + /** + * 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)); + }); + } } 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..4772a896da59 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,84 +12,101 @@ 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.DeviceManagementClientImpl; +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. */ +/** + * Initializes a new instance of the synchronous DeviceManagementClient type. + */ @ServiceClient(builder = DeviceManagementClientBuilder.class) public final class DeviceManagementClient { @Generated - private final DeviceManagementsImpl serviceClient; + private final DeviceManagementClientImpl serviceClient; /** * Initializes an instance of DeviceManagementClient class. - * + * * @param serviceClient the service client implementation. */ @Generated - DeviceManagementClient(DeviceManagementsImpl serviceClient) { + DeviceManagementClient(DeviceManagementClientImpl serviceClient) { this.serviceClient = serviceClient; } /** - * 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. @@ -868,7 +891,7 @@ 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. @@ -886,12 +909,12 @@ public Response deleteDeploymentWithResponse(String groupId, String deploy } /** - * 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 +947,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 +957,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 +968,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 +1010,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 +1024,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 +1044,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 +1070,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 +1093,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 +1106,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 +1126,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 +1136,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 +1149,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 +1210,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 +1240,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. @@ -1238,7 +1265,7 @@ public Response getDeploymentForDeviceClassSubgroupWithResponse(Stri /** * Deletes a device class subgroup deployment. - * + * * @param groupId Group identifier. * @param deviceClassId Device class identifier. * @param deploymentId Deployment identifier. @@ -1259,10 +1286,10 @@ public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String /** * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
+     * 

Response Body Schema

+ * + *
+     * {@code
      * {
      *     deploymentId: String (Required)
      *     startDateTime: OffsetDateTime (Required)
@@ -1289,9 +1316,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 +1340,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 +1370,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 +1393,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 +1424,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 +1435,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 +1447,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 +1480,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 +1493,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 +1529,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 +1547,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 +1607,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 +1624,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 +1644,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 +1665,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 +1682,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 +1701,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 +1736,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 +1757,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 +1777,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 +1810,1140 @@ public Response getLogCollectionDetailedStatusWithResponse(String lo public PagedIterable listHealthOfDevices(String filter, RequestOptions requestOptions) { return this.serviceClient.listHealthOfDevices(filter, 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); + } + + /** + * 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(); + } + + /** + * 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); + } + + /** + * 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(); + } + + /** + * 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)); + } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClientBuilder.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClientBuilder.java index f0ec24224173..1b4087225ab6 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClientBuilder.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClientBuilder.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,14 +32,17 @@ 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 com.azure.iot.deviceupdate.implementation.DeviceManagementClientImpl; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; -/** A builder for creating a new instance of the DeviceManagementClient type. */ +/** + * A builder for creating a new instance of the DeviceManagementClient type. + */ @ServiceClientBuilder(serviceClients = { DeviceManagementClient.class, DeviceManagementAsyncClient.class }) public final class DeviceManagementClientBuilder implements HttpTrait, ConfigurationTrait, @@ -60,37 +62,46 @@ public final class DeviceManagementClientBuilder @Generated private final List pipelinePolicies; - /** Create an instance of the DeviceManagementClientBuilder. */ + /** + * Create an instance of the DeviceManagementClientBuilder. + */ @Generated public DeviceManagementClientBuilder() { 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 DeviceManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public DeviceManagementClientBuilder 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 DeviceManagementClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + public DeviceManagementClientBuilder 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 +111,9 @@ public DeviceManagementClientBuilder httpClient(HttpClient httpClient) { @Generated private HttpLogOptions httpLogOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceManagementClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @@ -114,7 +127,9 @@ public DeviceManagementClientBuilder httpLogOptions(HttpLogOptions httpLogOption @Generated private ClientOptions clientOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceManagementClientBuilder clientOptions(ClientOptions clientOptions) { @@ -128,7 +143,9 @@ public DeviceManagementClientBuilder clientOptions(ClientOptions clientOptions) @Generated private RetryOptions retryOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceManagementClientBuilder retryOptions(RetryOptions retryOptions) { @@ -136,7 +153,9 @@ public DeviceManagementClientBuilder retryOptions(RetryOptions retryOptions) { return this; } - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceManagementClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @@ -151,7 +170,9 @@ public DeviceManagementClientBuilder addPolicy(HttpPipelinePolicy customPolicy) @Generated private Configuration configuration; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceManagementClientBuilder configuration(Configuration configuration) { @@ -165,7 +186,9 @@ public DeviceManagementClientBuilder configuration(Configuration configuration) @Generated private TokenCredential tokenCredential; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceManagementClientBuilder credential(TokenCredential tokenCredential) { @@ -179,7 +202,9 @@ public DeviceManagementClientBuilder credential(TokenCredential tokenCredential) @Generated private String endpoint; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceManagementClientBuilder endpoint(String endpoint) { @@ -195,7 +220,7 @@ public DeviceManagementClientBuilder endpoint(String endpoint) { /** * Sets The Device Update for IoT Hub account instance identifier. - * + * * @param instanceId the instanceId value. * @return the DeviceManagementClientBuilder. */ @@ -213,7 +238,7 @@ public DeviceManagementClientBuilder instanceId(String instanceId) { /** * Sets Service version. - * + * * @param serviceVersion the serviceVersion value. * @return the DeviceManagementClientBuilder. */ @@ -231,7 +256,7 @@ public DeviceManagementClientBuilder serviceVersion(DeviceUpdateServiceVersion s /** * Sets The retry policy that will attempt to retry failed requests, if applicable. - * + * * @param retryPolicy the retryPolicy value. * @return the DeviceManagementClientBuilder. */ @@ -242,20 +267,29 @@ public DeviceManagementClientBuilder retryPolicy(RetryPolicy retryPolicy) { } /** - * Builds an instance of DeviceUpdateClientImpl with the provided parameters. - * - * @return an instance of DeviceUpdateClientImpl. + * Builds an instance of DeviceManagementClientImpl with the provided parameters. + * + * @return an instance of DeviceManagementClientImpl. */ @Generated - private DeviceUpdateClientImpl buildInnerClient() { + private DeviceManagementClientImpl 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); + DeviceManagementClientImpl client = new DeviceManagementClientImpl(localPipeline, + 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 +303,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 +313,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 +320,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 +330,23 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of DeviceManagementAsyncClient class. - * + * * @return an instance of DeviceManagementAsyncClient. */ @Generated public DeviceManagementAsyncClient buildAsyncClient() { - return new DeviceManagementAsyncClient(buildInnerClient().getDeviceManagements()); + return new DeviceManagementAsyncClient(buildInnerClient()); } /** * Builds an instance of DeviceManagementClient class. - * + * * @return an instance of DeviceManagementClient. */ @Generated public DeviceManagementClient buildClient() { - return new DeviceManagementClient(buildInnerClient().getDeviceManagements()); + return new DeviceManagementClient(buildInnerClient()); } + + private static final ClientLogger LOGGER = new ClientLogger(DeviceManagementClientBuilder.class); } 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..4f2e137aa200 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,7 +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; import com.azure.core.annotation.Generated; @@ -12,19 +11,33 @@ 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.implementation.DeviceUpdateClientImpl; +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 - private final DeviceUpdatesImpl serviceClient; + private final DeviceUpdateClientImpl serviceClient; /** * Initializes an instance of DeviceUpdateAsyncClient class. @@ -32,72 +45,70 @@ public final class DeviceUpdateAsyncClient { * @param serviceClient the service client implementation. */ @Generated - DeviceUpdateAsyncClient(DeviceUpdatesImpl serviceClient) { + DeviceUpdateAsyncClient(DeviceUpdateClientImpl serviceClient) { this.serviceClient = serviceClient; } /** * 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. @@ -105,7 +116,7 @@ public final class DeviceUpdateAsyncClient { * @throws ResourceNotFoundException thrown if 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,7 +277,8 @@ public PollerFlux beginImportUpdate(BinaryData updateToI
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
+ * } + *
* * @param provider Update provider. * @param name Update name. @@ -275,8 +298,8 @@ 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. @@ -296,26 +319,23 @@ public PollerFlux beginDeleteUpdate(String provider, Str } /** - * 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,17 +345,13 @@ 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. @@ -343,8 +359,8 @@ public PagedFlux listProviders(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if 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,27 +370,20 @@ 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. @@ -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,17 +403,13 @@ 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. @@ -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,7 +477,8 @@ public PagedFlux listFiles(String provider, String name, String vers
      *     }
      *     etag: String (Optional)
      * }
-     * }
+ * } + *
* * @param provider Update provider. * @param name Update name. @@ -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,62 +500,61 @@ 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. @@ -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,7 +617,8 @@ 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. @@ -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..f91abcbf0019 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,7 +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; import com.azure.core.annotation.Generated; @@ -12,18 +11,27 @@ 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.implementation.DeviceUpdateClientImpl; +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 - private final DeviceUpdatesImpl serviceClient; + private final DeviceUpdateClientImpl serviceClient; /** * Initializes an instance of DeviceUpdateClient class. @@ -31,72 +39,70 @@ public final class DeviceUpdateClient { * @param serviceClient the service client implementation. */ @Generated - DeviceUpdateClient(DeviceUpdatesImpl serviceClient) { + DeviceUpdateClient(DeviceUpdateClientImpl serviceClient) { this.serviceClient = serviceClient; } /** * 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. @@ -104,7 +110,7 @@ public final class DeviceUpdateClient { * @throws ResourceNotFoundException thrown if 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,7 +271,8 @@ public SyncPoller beginImportUpdate(BinaryData updateToI
      *     createdDateTime: OffsetDateTime (Required)
      *     etag: String (Optional)
      * }
-     * }
+ * } + *
* * @param provider Update provider. * @param name Update name. @@ -274,8 +292,8 @@ 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. @@ -295,26 +313,23 @@ public SyncPoller beginDeleteUpdate(String provider, Str } /** - * 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,17 +339,13 @@ 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. @@ -342,8 +353,8 @@ public PagedIterable listProviders(RequestOptions requestOptions) { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if 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,27 +364,20 @@ 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. @@ -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,17 +397,13 @@ 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. @@ -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,7 +471,8 @@ public PagedIterable listFiles(String provider, String name, String
      *     }
      *     etag: String (Optional)
      * }
-     * }
+ * } + *
* * @param provider Update provider. * @param name Update name. @@ -493,62 +493,61 @@ 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. @@ -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,7 +610,8 @@ 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. @@ -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..13bdf45fb045 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,7 +40,9 @@ import java.util.Map; import java.util.Objects; -/** A builder for creating a new instance of the DeviceUpdateClient type. */ +/** + * A builder for creating a new instance of the DeviceUpdateClient type. + */ @ServiceClientBuilder(serviceClients = { DeviceUpdateClient.class, DeviceUpdateAsyncClient.class }) public final class DeviceUpdateClientBuilder implements HttpTrait, ConfigurationTrait, @@ -60,37 +62,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 +111,9 @@ public DeviceUpdateClientBuilder httpClient(HttpClient httpClient) { @Generated private HttpLogOptions httpLogOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @@ -114,7 +127,9 @@ public DeviceUpdateClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @Generated private ClientOptions clientOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder clientOptions(ClientOptions clientOptions) { @@ -128,7 +143,9 @@ public DeviceUpdateClientBuilder clientOptions(ClientOptions clientOptions) { @Generated private RetryOptions retryOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder retryOptions(RetryOptions retryOptions) { @@ -136,7 +153,9 @@ public DeviceUpdateClientBuilder retryOptions(RetryOptions retryOptions) { return this; } - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @@ -151,7 +170,9 @@ public DeviceUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @Generated private Configuration configuration; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder configuration(Configuration configuration) { @@ -165,7 +186,9 @@ public DeviceUpdateClientBuilder configuration(Configuration configuration) { @Generated private TokenCredential tokenCredential; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder credential(TokenCredential tokenCredential) { @@ -179,7 +202,9 @@ public DeviceUpdateClientBuilder credential(TokenCredential tokenCredential) { @Generated private String endpoint; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public DeviceUpdateClientBuilder endpoint(String endpoint) { @@ -195,7 +220,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 +238,7 @@ public DeviceUpdateClientBuilder instanceId(String instanceId) { /** * Sets Service version. - * + * * @param serviceVersion the serviceVersion value. * @return the DeviceUpdateClientBuilder. */ @@ -231,7 +256,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 +268,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 +303,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 +313,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 +320,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 +330,23 @@ private HttpPipeline createHttpPipeline() { /** * Builds an instance of DeviceUpdateAsyncClient class. - * + * * @return an instance of DeviceUpdateAsyncClient. */ @Generated public DeviceUpdateAsyncClient buildAsyncClient() { - return new DeviceUpdateAsyncClient(buildInnerClient().getDeviceUpdates()); + return new DeviceUpdateAsyncClient(buildInnerClient()); } /** * Builds an instance of DeviceUpdateClient class. - * + * * @return an instance of DeviceUpdateClient. */ @Generated public DeviceUpdateClient buildClient() { - return new DeviceUpdateClient(buildInnerClient().getDeviceUpdates()); + return new DeviceUpdateClient(buildInnerClient()); } + + 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/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementClientImpl.java similarity index 84% rename from sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java rename to sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementClientImpl.java index 98b475361d15..7e2642530933 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementClientImpl.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; @@ -24,6 +24,10 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; @@ -34,12 +38,16 @@ 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.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; 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; @@ -47,46 +55,136 @@ import reactor.core.publisher.Mono; /** - * An instance of this class provides access to all the operations defined in DeviceManagements. + * Initializes a new instance of the DeviceManagementClient type. */ -public final class DeviceManagementsImpl { +public final class DeviceManagementClientImpl { /** * The proxy service used to perform REST calls. */ - private final DeviceManagementsService service; + private final DeviceManagementClientService service; /** - * The service client containing this operation class. + * The Device Update for IoT Hub account endpoint (hostname only, no protocol). */ - private final DeviceUpdateClientImpl client; + private final String endpoint; /** - * Initializes an instance of DeviceManagementsImpl. + * Gets The Device Update for IoT Hub account endpoint (hostname only, no protocol). * - * @param client the instance of the service client containing this operation class. + * @return the endpoint value. */ - DeviceManagementsImpl(DeviceUpdateClientImpl client) { - this.service - = RestProxy.create(DeviceManagementsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; + public String getEndpoint() { + return this.endpoint; } + /** + * 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. + */ + private final DeviceUpdateServiceVersion serviceVersion; + /** * Gets Service version. * * @return the serviceVersion value. */ public DeviceUpdateServiceVersion getServiceVersion() { - return client.getServiceVersion(); + return this.serviceVersion; + } + + /** + * 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. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of DeviceManagementClient 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 DeviceManagementClientImpl(String endpoint, String instanceId, DeviceUpdateServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, instanceId, serviceVersion); + } + + /** + * Initializes an instance of DeviceManagementClient 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. + * @param serviceVersion Service version. + */ + public DeviceManagementClientImpl(HttpPipeline httpPipeline, String endpoint, String instanceId, + DeviceUpdateServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, instanceId, serviceVersion); + } + + /** + * Initializes an instance of DeviceManagementClient 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). + * @param instanceId The Device Update for IoT Hub account instance identifier. + * @param serviceVersion Service version. + */ + public DeviceManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + String instanceId, DeviceUpdateServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.instanceId = instanceId; + this.serviceVersion = serviceVersion; + this.service + = RestProxy.create(DeviceManagementClientService.class, this.httpPipeline, this.getSerializerAdapter()); } /** - * The interface defining all the services for DeviceUpdateClientDeviceManagements to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for DeviceManagementClient to be used by the proxy service to perform + * REST calls. */ @Host("https://{endpoint}") - @ServiceInterface(name = "DeviceUpdateClientDeviceManagements") - public interface DeviceManagementsService { + @ServiceInterface(name = "DeviceManagementClient") + public interface DeviceManagementClientService { @Get("/deviceUpdate/{instanceId}/management/deviceClasses") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -94,9 +192,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 }) @@ -105,9 +202,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 }) @@ -116,9 +212,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 }) @@ -127,9 +223,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 }) @@ -138,10 +234,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 }) @@ -150,10 +247,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 }) @@ -162,9 +260,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 }) @@ -173,9 +270,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 }) @@ -184,9 +280,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 }) @@ -195,9 +291,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 }) @@ -206,9 +302,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 }) @@ -217,9 +312,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 }) @@ -228,9 +322,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 }) @@ -239,9 +333,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 }) @@ -250,9 +344,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 }) @@ -261,9 +355,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 }) @@ -272,8 +366,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}") @@ -283,8 +377,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") @@ -294,9 +388,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 }) @@ -305,9 +398,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 }) @@ -316,9 +408,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 }) @@ -327,9 +418,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 }) @@ -338,9 +428,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 }) @@ -349,9 +439,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 }) @@ -360,9 +450,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 }) @@ -371,9 +460,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 }) @@ -382,9 +470,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 }) @@ -393,9 +481,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 }) @@ -404,9 +492,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 }) @@ -415,9 +503,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 }) @@ -426,9 +514,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 }) @@ -437,9 +525,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 }) @@ -448,8 +536,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}") @@ -459,8 +547,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}") @@ -470,10 +558,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 }) @@ -482,10 +570,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); + @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); @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @ExpectedResponses({ 204 }) @@ -494,9 +582,9 @@ Response createOrUpdateDeploymentSync(@HostParam("endpoint") String @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); + @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 }) @@ -505,9 +593,9 @@ Mono> deleteDeployment(@HostParam("endpoint") String endpoint, @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, + RequestOptions requestOptions, Context context); @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") @ExpectedResponses({ 200 }) @@ -516,8 +604,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") @@ -527,8 +615,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") @@ -538,9 +626,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 }) @@ -549,9 +637,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 }) @@ -560,8 +648,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}") @@ -571,8 +659,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}") @@ -582,9 +670,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 }) @@ -593,9 +681,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 }) @@ -604,8 +692,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") @@ -615,8 +703,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") @@ -626,8 +714,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") @@ -637,8 +725,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") @@ -648,8 +736,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") @@ -659,8 +747,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}") @@ -670,9 +758,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}") @@ -682,9 +770,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, + @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); @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") @@ -694,10 +782,9 @@ Response getDeploymentForDeviceClassSubgroupSync(@HostParam("endpoin @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); + @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 }) @@ -706,10 +793,9 @@ Mono> deleteDeploymentForDeviceClassSubgroup(@HostParam("endpoint @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, - RequestOptions requestOptions, Context context); + @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); @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:cancel") @ExpectedResponses({ 200 }) @@ -718,9 +804,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") @@ -730,9 +816,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") @@ -742,9 +828,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") @@ -754,9 +840,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") @@ -766,9 +852,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") @@ -778,9 +864,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") @@ -790,9 +876,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") @@ -802,9 +888,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}") @@ -814,9 +900,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 }) @@ -825,9 +911,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 }) @@ -836,9 +922,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 }) @@ -847,9 +932,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 }) @@ -858,9 +942,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}") @@ -870,9 +954,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}") @@ -882,9 +966,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 }) @@ -893,9 +977,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 }) @@ -904,9 +988,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 }) @@ -915,9 +998,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 }) @@ -926,9 +1008,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 }) @@ -937,9 +1019,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 }) @@ -948,9 +1030,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 }) @@ -959,9 +1041,9 @@ 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); @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -1205,9 +1287,10 @@ 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. + * 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

* * @@ -1250,24 +1333,26 @@ Response listHealthOfDevicesNextSync(@PathParam(value = "nextLink", * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if 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)) + .withContext(context -> service.listDeviceClasses(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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. + * 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
* @@ -1310,9 +1395,10 @@ private Mono> listDeviceClassesSinglePageAsync(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 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) { @@ -1324,9 +1410,10 @@ 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. + * 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
* @@ -1369,23 +1456,25 @@ public PagedFlux listDeviceClassesAsync(RequestOptions 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 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. + * 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
* @@ -1428,9 +1517,10 @@ private PagedResponse listDeviceClassesSinglePage(RequestOptions 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 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) { @@ -1485,8 +1575,8 @@ public Mono> getDeviceClassWithResponseAsync(String deviceC 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)); + .withContext(context -> service.getDeviceClass(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), deviceClassId, accept, requestOptions, context)); } /** @@ -1531,8 +1621,8 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), deviceClassId, accept, requestOptions, Context.NONE); } /** @@ -1542,7 +1632,7 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req *
      * {@code
      * {
-     *     friendlyName: String (Required)
+     *     friendlyName: String (Optional, Required on create)
      * }
      * }
      * 
@@ -1577,7 +1667,8 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req * * * @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. @@ -1588,10 +1679,11 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), deviceClassId, contentType, accept, deviceClassPatch, requestOptions, context)); } /** @@ -1601,7 +1693,7 @@ public Mono> updateDeviceClassWithResponseAsync(String devi *
      * {@code
      * {
-     *     friendlyName: String (Required)
+     *     friendlyName: String (Optional, Required on create)
      * }
      * }
      * 
@@ -1636,7 +1728,8 @@ public Mono> updateDeviceClassWithResponseAsync(String devi * * * @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. @@ -1647,17 +1740,20 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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. @@ -1670,18 +1766,18 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. @@ -1693,9 +1789,8 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), deviceClassId, requestOptions, Context.NONE); } /** @@ -1730,9 +1825,9 @@ private Mono> listInstallableUpdatesForDeviceClassSing RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listInstallableUpdatesForDeviceClass(this.client.getEndpoint(), - this.client.getInstanceId(), deviceClassId, this.client.getServiceVersion().getVersion(), accept, - requestOptions, context)) + .withContext(context -> service.listInstallableUpdatesForDeviceClass(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), deviceClassId, accept, requestOptions, + context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -1803,9 +1898,9 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), deviceClassId, accept, requestOptions, + Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -1853,8 +1948,9 @@ public PagedIterable listInstallableUpdatesForDeviceClass(String dev *
* * + * 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 ParametersQuery 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

@@ -1909,8 +2005,8 @@ public PagedIterable listInstallableUpdatesForDeviceClass(String dev 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -1922,8 +2018,9 @@ private Mono> listDevicesSinglePageAsync(RequestOption * 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). + * 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

@@ -1989,8 +2086,9 @@ public PagedFlux listDevicesAsync(RequestOptions requestOptions) { * 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). + * 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

@@ -2043,8 +2141,8 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -2056,8 +2154,9 @@ private PagedResponse listDevicesSinglePage(RequestOptions requestOp * 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). + * 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

@@ -2118,8 +2217,8 @@ 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. + * 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

* *
@@ -2138,15 +2237,15 @@ public PagedIterable listDevices(RequestOptions requestOptions) {
      */
     @ServiceMethod(returns = ReturnType.SINGLE)
     private Mono> importDevicesWithResponseAsync(BinaryData importType, RequestOptions requestOptions) {
-        final String accept = "application/json";
+        final String contentType = "application/json";
         return FluxUtil
-            .withContext(context -> service.importDevices(this.client.getEndpoint(), this.client.getInstanceId(),
-                this.client.getServiceVersion().getVersion(), importType, accept, requestOptions, context));
+            .withContext(context -> service.importDevices(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                this.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.
+     * 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

* *
@@ -2165,14 +2264,80 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(),
+            this.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
+     * 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.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.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. + * 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.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.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

* *
@@ -2194,17 +2359,18 @@ 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.getHttpPipeline())
+                .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint()))
+                .setContext(requestOptions != null && requestOptions.getContext() != null
                     ? requestOptions.getContext()
-                    : Context.NONE),
+                    : Context.NONE)
+                .setServiceVersion(this.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.
+     * 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

* *
@@ -2225,17 +2391,18 @@ public PollerFlux beginImportDevicesAsync(BinaryData imp
     public SyncPoller beginImportDevices(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()))
+            new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
+                .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint()))
                 .setContext(requestOptions != null && requestOptions.getContext() != null
                     ? requestOptions.getContext()
                     : Context.NONE)
-                .setServiceVersion(this.client.getServiceVersion().getVersion())),
+                .setServiceVersion(this.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.
+     * Gets the device properties and latest deployment status for a device connected
+     * to Device Update for IoT Hub.
      * 

Response Body Schema

* *
@@ -2282,18 +2449,19 @@ public SyncPoller beginImportDevices(BinaryData importTy
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if 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.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.getInstanceId(), deviceId, accept, requestOptions, context));
     }
 
     /**
-     * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub.
+     * Gets the device properties and latest deployment status for a device connected
+     * to Device Update for IoT Hub.
      * 

Response Body Schema

* *
@@ -2340,19 +2508,19 @@ public Mono> getDeviceWithResponseAsync(String deviceId, Re
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if 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.getEndpoint(), this.getServiceVersion().getVersion(), this.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.
+     * Gets the device module properties and latest deployment status for a device
+     * module connected to Device Update for IoT Hub.
      * 

Response Body Schema

* *
@@ -2400,21 +2568,22 @@ 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));
+            .withContext(context -> service.getDeviceModule(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                this.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.
+     * Gets the device module properties and latest deployment status for a device
+     * module connected to Device Update for IoT Hub.
      * 

Response Body Schema

* *
@@ -2462,20 +2631,20 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(),
+            this.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.
+     * 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

* *
@@ -2494,20 +2663,20 @@ public Response getDeviceModuleWithResponse(String deviceId, 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 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.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * 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

* *
@@ -2526,25 +2695,27 @@ public Mono> getUpdateComplianceWithResponseAsync(RequestOp
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if 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.getEndpoint(), this.getServiceVersion().getVersion(),
+            this.getInstanceId(), accept, requestOptions, Context.NONE);
     }
 
     /**
-     * Gets a list of all device groups. The $default group will always be returned first.
+     * Gets a list of all device groups. The $default group will always be returned
+     * first.
      * 

Query Parameters

* * * * + * 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

@@ -2577,21 +2748,23 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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. + * Gets a list of all device groups. The $default group will always be returned + * first. *

Query Parameters

* * * * + * 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

@@ -2630,14 +2803,16 @@ public PagedFlux listGroupsAsync(RequestOptions requestOptions) { } /** - * Gets a list of all device groups. The $default group will always be returned first. + * Gets a list of all device groups. The $default group will always be returned + * first. *

Query Parameters

* * * * + * 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

@@ -2669,21 +2844,23 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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. + * Gets a list of all device groups. The $default group will always be returned + * first. *

Query Parameters

* * * * + * 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

@@ -2753,8 +2930,8 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, accept, requestOptions, context)); } /** @@ -2789,16 +2966,18 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), this.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. @@ -2810,18 +2989,18 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. @@ -2833,14 +3012,14 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), this.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. + * 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

* *
@@ -2860,22 +3039,22 @@ public Response deleteGroupWithResponse(String groupId, RequestOptions 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 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.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * 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

* *
@@ -2895,18 +3074,20 @@ public Mono> getUpdateComplianceForGroupWithResponseAsync(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 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.getEndpoint(), this.getServiceVersion().getVersion(),
+            this.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.
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
      * 

Response Body Schema

* *
@@ -2934,23 +3115,23 @@ public Response getUpdateComplianceForGroupWithResponse(String group
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if 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.getEndpoint(),
+                this.getServiceVersion().getVersion(), this.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.
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
      * 

Response Body Schema

* *
@@ -2978,8 +3159,8 @@ private Mono> listBestUpdatesForGroupSinglePageAsync(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 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) {
@@ -2991,7 +3172,8 @@ 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.
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
      * 

Response Body Schema

* *
@@ -3019,21 +3201,21 @@ public PagedFlux listBestUpdatesForGroupAsync(String groupId, Reques
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if 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.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * Get the best available updates for a device group and a count of how many
+     * devices need each update.
      * 

Response Body Schema

* *
@@ -3061,8 +3243,8 @@ private PagedResponse listBestUpdatesForGroupSinglePage(String group
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if 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) {
@@ -3113,6 +3295,7 @@ public PagedIterable listBestUpdatesForGroup(String groupId, Request
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
      * }
      * 
@@ -3131,9 +3314,8 @@ private Mono> listDeploymentsForGroupSinglePageAsync(S 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -3178,6 +3360,7 @@ private Mono> listDeploymentsForGroupSinglePageAsync(S * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3239,6 +3422,7 @@ public PagedFlux listDeploymentsForGroupAsync(String groupId, Reques * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3254,9 +3438,8 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -3301,6 +3484,7 @@ private PagedResponse listDeploymentsForGroupSinglePage(String group * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3354,6 +3538,7 @@ public PagedIterable listDeploymentsForGroup(String groupId, Request * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3372,8 +3557,8 @@ public Mono> getDeploymentWithResponseAsync(String groupId, 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)); + .withContext(context -> service.getDeployment(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deploymentId, accept, requestOptions, context)); } /** @@ -3408,6 +3593,7 @@ public Mono> getDeploymentWithResponseAsync(String groupId, * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3425,8 +3611,8 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deploymentId, accept, requestOptions, Context.NONE); } /** @@ -3461,6 +3647,7 @@ public Response getDeploymentWithResponse(String groupId, String dep * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3495,6 +3682,7 @@ public Response getDeploymentWithResponse(String groupId, String dep * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3512,10 +3700,11 @@ 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)); + return FluxUtil.withContext( + context -> service.createOrUpdateDeployment(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deploymentId, contentType, accept, deployment, requestOptions, context)); } /** @@ -3550,6 +3739,7 @@ public Mono> createOrUpdateDeploymentWithResponseAsync(Stri * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3584,6 +3774,7 @@ public Mono> createOrUpdateDeploymentWithResponseAsync(Stri * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -3601,10 +3792,10 @@ public Mono> createOrUpdateDeploymentWithResponseAsync(Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateDeploymentWithResponse(String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { + final String contentType = "application/json"; 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); + return service.createOrUpdateDeploymentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deploymentId, contentType, accept, deployment, requestOptions, Context.NONE); } /** @@ -3622,10 +3813,9 @@ public Response createOrUpdateDeploymentWithResponse(String groupId, @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)); + .withContext(context -> service.deleteDeployment(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deploymentId, requestOptions, context)); } /** @@ -3643,14 +3833,13 @@ public Mono> deleteDeploymentWithResponseAsync(String groupId, St @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDeploymentWithResponse(String groupId, String deploymentId, RequestOptions requestOptions) { - 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.deleteDeploymentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deploymentId, 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. + * 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

* *
@@ -3697,21 +3886,22 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(),
+                this.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.
+     * 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

* *
@@ -3758,27 +3948,29 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(),
+            this.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.
+     * 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

* * * * + * 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

@@ -3809,23 +4001,24 @@ private Mono> listDeviceClassSubgroupsForGroupSinglePa RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDeviceClassSubgroupsForGroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, this.client.getServiceVersion().getVersion(), accept, - requestOptions, context)) + .withContext(context -> service.listDeviceClassSubgroupsForGroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. + * 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

* * * * + * 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

@@ -3860,15 +4053,17 @@ 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. + * 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

* * * * + * 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

@@ -3897,23 +4092,24 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. + * 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

* * * * + * 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

@@ -3948,8 +4144,9 @@ 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. + * 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

* *
@@ -3978,13 +4175,14 @@ public Mono> getDeviceClassSubgroupWithResponseAsync(String
         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));
+            context -> service.getDeviceClassSubgroup(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                this.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.
+     * 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

* *
@@ -4012,16 +4210,19 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(),
+            this.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.
@@ -4035,18 +4236,20 @@ 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));
+            context -> service.deleteDeviceClassSubgroup(this.getEndpoint(), this.getServiceVersion().getVersion(),
+                this.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.
@@ -4060,14 +4263,14 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(),
+            this.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.
+     * 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

* *
@@ -4088,22 +4291,23 @@ 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,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.getDeviceClassSubgroupUpdateCompliance(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * 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

* *
@@ -4124,20 +4328,22 @@ 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,
-            requestOptions, Context.NONE);
+        return service.getDeviceClassSubgroupUpdateComplianceSync(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * Get the best available update for a device class subgroup and a count of how
+     * many devices need this update.
      * 

Response Body Schema

* *
@@ -4166,20 +4372,21 @@ 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,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.getBestUpdatesForDeviceClassSubgroup(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * Get the best available update for a device class subgroup and a count of how
+     * many devices need this update.
      * 

Response Body Schema

* *
@@ -4208,15 +4415,16 @@ 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.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, deviceClassId, accept, requestOptions,
+            Context.NONE);
     }
 
     /**
@@ -4259,6 +4467,7 @@ public Response getBestUpdatesForDeviceClassSubgroupWithResponse(Str
      *         }
      *     }
      *     isCloudInitiatedRollback: Boolean (Optional)
+     *     downloadSecurity: String(https/http) (Optional)
      * }
      * }
      * 
@@ -4278,9 +4487,9 @@ private Mono> listDeploymentsForDeviceClassSubgroupSin String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDeploymentsForDeviceClassSubgroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, this.client.getServiceVersion().getVersion(), - accept, requestOptions, context)) + .withContext(context -> service.listDeploymentsForDeviceClassSubgroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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)); } @@ -4325,6 +4534,7 @@ private Mono> listDeploymentsForDeviceClassSubgroupSin * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4389,6 +4599,7 @@ public PagedFlux listDeploymentsForDeviceClassSubgroupAsync(String g * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4406,9 +4617,9 @@ public PagedFlux listDeploymentsForDeviceClassSubgroupAsync(String g private PagedResponse listDeploymentsForDeviceClassSubgroupSinglePage(String groupId, 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, - requestOptions, Context.NONE); + Response res = service.listDeploymentsForDeviceClassSubgroupSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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); } @@ -4453,6 +4664,7 @@ private PagedResponse listDeploymentsForDeviceClassSubgroupSinglePag * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4509,6 +4721,7 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup(String gr * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4527,9 +4740,9 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup(String gr public Mono> getDeploymentForDeviceClassSubgroupWithResponseAsync(String groupId, 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)); + return FluxUtil.withContext(context -> service.getDeploymentForDeviceClassSubgroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, deviceClassId, deploymentId, accept, + requestOptions, context)); } /** @@ -4564,6 +4777,7 @@ public Mono> getDeploymentForDeviceClassSubgroupWithRespons * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4582,9 +4796,9 @@ 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); + return service.getDeploymentForDeviceClassSubgroupSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, deviceClassId, deploymentId, accept, + requestOptions, Context.NONE); } /** @@ -4603,10 +4817,9 @@ public Response getDeploymentForDeviceClassSubgroupWithResponse(Stri @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)); + return FluxUtil.withContext(context -> service.deleteDeploymentForDeviceClassSubgroup(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, deviceClassId, deploymentId, + requestOptions, context)); } /** @@ -4625,10 +4838,9 @@ public Mono> deleteDeploymentForDeviceClassSubgroupWithResponseAs @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.deleteDeploymentForDeviceClassSubgroupSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), groupId, deviceClassId, deploymentId, + requestOptions, Context.NONE); } /** @@ -4663,6 +4875,7 @@ public Response deleteDeploymentForDeviceClassSubgroupWithResponse(String * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4681,9 +4894,9 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deviceClassId, deploymentId, accept, requestOptions, context)); } /** @@ -4718,6 +4931,7 @@ public Mono> stopDeploymentWithResponseAsync(String groupId * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4736,9 +4950,8 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deviceClassId, deploymentId, accept, requestOptions, Context.NONE); } /** @@ -4773,6 +4986,7 @@ public Response stopDeploymentWithResponse(String groupId, String de * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4791,9 +5005,9 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), groupId, deviceClassId, deploymentId, accept, requestOptions, context)); } /** @@ -4828,6 +5042,7 @@ public Mono> retryDeploymentWithResponseAsync(String groupI * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -4846,14 +5061,13 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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. + * 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

* *
@@ -4894,21 +5108,22 @@ 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));
+        return FluxUtil.withContext(context -> service.getDeviceClassSubgroupDeploymentStatus(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * 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

* *
@@ -4949,26 +5164,28 @@ 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);
+        return service.getDeviceClassSubgroupDeploymentStatusSync(this.getEndpoint(),
+            this.getServiceVersion().getVersion(), this.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.
+     * Gets a list of devices in a deployment along with their state. Useful for
+     * getting a list of failed devices.
      * 

Query Parameters

* * * * + * 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

@@ -5001,21 +5218,23 @@ private Mono> listDeviceStatesForDeviceClassSubgroupDe String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { 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)) + .withContext(context -> service.listDeviceStatesForDeviceClassSubgroupDeployment(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. *

Query Parameters

* * * * + * 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

@@ -5056,13 +5275,15 @@ public PagedFlux listDeviceStatesForDeviceClassSubgroupDeploymentAsy } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. *

Query Parameters

* * * * + * 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

@@ -5093,21 +5314,23 @@ public PagedFlux listDeviceStatesForDeviceClassSubgroupDeploymentAsy private PagedResponse listDeviceStatesForDeviceClassSubgroupDeploymentSinglePage(String groupId, 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); + Response res = service.listDeviceStatesForDeviceClassSubgroupDeploymentSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. + * Gets a list of devices in a deployment along with their state. Useful for + * getting a list of failed devices. *

Query Parameters

* * * * + * 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

@@ -5155,7 +5378,8 @@ public PagedIterable listDeviceStatesForDeviceClassSubgroupDeploymen * 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. + * 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

@@ -5200,9 +5424,8 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), operationId, accept, requestOptions, context)); } /** @@ -5212,7 +5435,8 @@ public Mono> getOperationStatusWithResponseAsync(String ope * 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. + * 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

@@ -5256,21 +5480,24 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), operationId, accept, requestOptions, Context.NONE); } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. *

Query Parameters

* * * * + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'" * + * 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

@@ -5315,24 +5542,26 @@ public Response getOperationStatusWithResponse(String operationId, R 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)) + .withContext(context -> service.listOperationStatuses(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. *

Query Parameters

* * * * + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'" * + * 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

@@ -5382,16 +5611,19 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp } /** - * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. *

Query Parameters

* * * * + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'" * + * 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

@@ -5434,24 +5666,26 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp @ServiceMethod(returns = ReturnType.SINGLE) 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); + Response res = service.listOperationStatusesSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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. + * Get a list of all device import operations. Completed operations are kept for 7 + * days before auto-deleted. *

Query Parameters

* * * * + * filter is + * supported: "status eq 'NotStarted' or status eq 'Running'" * + * 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

@@ -5554,10 +5788,11 @@ 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)); + return FluxUtil.withContext( + context -> service.startLogCollection(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), logCollectionId, contentType, accept, logCollection, requestOptions, context)); } /** @@ -5614,9 +5849,10 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), logCollectionId, contentType, accept, logCollection, requestOptions, Context.NONE); } /** @@ -5655,8 +5891,8 @@ public Mono> getLogCollectionWithResponseAsync(String logCo 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)); + .withContext(context -> service.getLogCollection(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), logCollectionId, accept, requestOptions, context)); } /** @@ -5692,8 +5928,8 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), logCollectionId, accept, requestOptions, Context.NONE); } /** @@ -5730,8 +5966,8 @@ public Response getLogCollectionWithResponse(String logCollectionId, 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)) + .withContext(context -> service.listLogCollections(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -5806,9 +6042,8 @@ public PagedFlux listLogCollectionsAsync(RequestOptions requestOptio @ServiceMethod(returns = ReturnType.SINGLE) 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); + Response res = service.listLogCollectionsSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -5890,8 +6125,8 @@ public Mono> getLogCollectionDetailedStatusWithResponseAsyn 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)); + context -> service.getLogCollectionDetailedStatus(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), logCollectionId, accept, requestOptions, context)); } /** @@ -5932,8 +6167,8 @@ 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), logCollectionId, accept, requestOptions, Context.NONE); } /** @@ -5957,8 +6192,8 @@ 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. @@ -5971,8 +6206,8 @@ 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.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), filter, accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -5998,8 +6233,8 @@ 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. @@ -6037,8 +6272,8 @@ 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. @@ -6049,9 +6284,8 @@ public PagedFlux listHealthOfDevicesAsync(String filter, RequestOpti @ServiceMethod(returns = ReturnType.SINGLE) 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); + Response res = service.listHealthOfDevicesSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), filter, accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -6077,8 +6311,8 @@ 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. @@ -6132,17 +6366,18 @@ public PagedIterable listHealthOfDevices(String filter, RequestOptio * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if 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> listDeviceClassesNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDeviceClassesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) + .withContext( + context -> service.listDeviceClassesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6184,15 +6419,16 @@ private Mono> listDeviceClassesNextSinglePageAsync(Str * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if 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 listDeviceClassesNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listDeviceClassesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); + Response res + = service.listDeviceClassesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -6229,8 +6465,8 @@ private Mono> listInstallableUpdatesForDeviceClassNext RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listInstallableUpdatesForDeviceClassNext(nextLink, - this.client.getEndpoint(), accept, requestOptions, context)) + .withContext(context -> service.listInstallableUpdatesForDeviceClassNext(nextLink, this.getEndpoint(), + accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6265,8 +6501,8 @@ private Mono> listInstallableUpdatesForDeviceClassNext private PagedResponse listInstallableUpdatesForDeviceClassNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listInstallableUpdatesForDeviceClassNextSync(nextLink, - this.client.getEndpoint(), accept, requestOptions, Context.NONE); + Response res = service.listInstallableUpdatesForDeviceClassNextSync(nextLink, this.getEndpoint(), + accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -6326,8 +6562,9 @@ private PagedResponse listInstallableUpdatesForDeviceClassNextSingle private Mono> listDevicesNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listDevicesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + return FluxUtil + .withContext( + context -> service.listDevicesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6386,7 +6623,7 @@ private Mono> listDevicesNextSinglePageAsync(String ne private PagedResponse listDevicesNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listDevicesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); + = service.listDevicesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -6426,7 +6663,7 @@ private Mono> listGroupsNextSinglePageAsync(String nex final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listGroupsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + context -> service.listGroupsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6464,7 +6701,7 @@ private Mono> listGroupsNextSinglePageAsync(String nex private PagedResponse listGroupsNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; Response res - = service.listGroupsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); + = service.listGroupsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -6498,15 +6735,15 @@ private PagedResponse listGroupsNextSinglePage(String nextLink, 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 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> listBestUpdatesForGroupNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listBestUpdatesForGroupNext(nextLink, this.client.getEndpoint(), accept, + .withContext(context -> service.listBestUpdatesForGroupNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); @@ -6541,14 +6778,14 @@ private Mono> listBestUpdatesForGroupNextSinglePageAsy * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if 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 listBestUpdatesForGroupNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listBestUpdatesForGroupNextSync(nextLink, this.client.getEndpoint(), accept, + Response res = service.listBestUpdatesForGroupNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); @@ -6586,6 +6823,7 @@ private PagedResponse listBestUpdatesForGroupNextSinglePage(String n * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -6604,7 +6842,7 @@ private Mono> listDeploymentsForGroupNextSinglePageAsy RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDeploymentsForGroupNext(nextLink, this.client.getEndpoint(), accept, + .withContext(context -> service.listDeploymentsForGroupNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); @@ -6642,6 +6880,7 @@ private Mono> listDeploymentsForGroupNextSinglePageAsy * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } *
@@ -6658,7 +6897,7 @@ private Mono> listDeploymentsForGroupNextSinglePageAsy private PagedResponse listDeploymentsForGroupNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listDeploymentsForGroupNextSync(nextLink, this.client.getEndpoint(), accept, + Response res = service.listDeploymentsForGroupNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); @@ -6694,8 +6933,8 @@ private Mono> listDeviceClassSubgroupsForGroupNextSing RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDeviceClassSubgroupsForGroupNext(nextLink, this.client.getEndpoint(), - accept, requestOptions, context)) + .withContext(context -> service.listDeviceClassSubgroupsForGroupNext(nextLink, this.getEndpoint(), accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6728,7 +6967,7 @@ private Mono> listDeviceClassSubgroupsForGroupNextSing private PagedResponse listDeviceClassSubgroupsForGroupNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listDeviceClassSubgroupsForGroupNextSync(nextLink, this.client.getEndpoint(), + Response res = service.listDeviceClassSubgroupsForGroupNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); @@ -6766,6 +7005,7 @@ private PagedResponse listDeviceClassSubgroupsForGroupNextSinglePage * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } * @@ -6784,8 +7024,8 @@ private Mono> listDeploymentsForDeviceClassSubgroupNex RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listDeploymentsForDeviceClassSubgroupNext(nextLink, - this.client.getEndpoint(), accept, requestOptions, context)) + .withContext(context -> service.listDeploymentsForDeviceClassSubgroupNext(nextLink, this.getEndpoint(), + accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6822,6 +7062,7 @@ private Mono> listDeploymentsForDeviceClassSubgroupNex * } * } * isCloudInitiatedRollback: Boolean (Optional) + * downloadSecurity: String(https/http) (Optional) * } * } * @@ -6838,8 +7079,8 @@ private Mono> listDeploymentsForDeviceClassSubgroupNex private PagedResponse listDeploymentsForDeviceClassSubgroupNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listDeploymentsForDeviceClassSubgroupNextSync(nextLink, - this.client.getEndpoint(), accept, requestOptions, Context.NONE); + Response res = service.listDeploymentsForDeviceClassSubgroupNextSync(nextLink, this.getEndpoint(), + accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -6875,7 +7116,7 @@ private Mono> listDeviceStatesForDeviceClassSubgroupDe final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeviceStatesForDeviceClassSubgroupDeploymentNext(nextLink, - this.client.getEndpoint(), accept, requestOptions, context)) + this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6909,7 +7150,7 @@ private PagedResponse listDeviceStatesForDeviceClassSubgroupDeployme RequestOptions requestOptions) { final String accept = "application/json"; Response res = service.listDeviceStatesForDeviceClassSubgroupDeploymentNextSync(nextLink, - this.client.getEndpoint(), accept, requestOptions, Context.NONE); + this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -6923,6 +7164,16 @@ private PagedResponse listDeviceStatesForDeviceClassSubgroupDeployme * { * 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) @@ -6952,16 +7203,15 @@ 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 all device import operations along with {@link PagedResponse} on successful completion of + * @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, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOperationStatusesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) + return FluxUtil.withContext( + context -> service.listOperationStatusesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -6975,6 +7225,16 @@ private Mono> listOperationStatusesNextSinglePageAsync * { * 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) @@ -7004,14 +7264,14 @@ private Mono> listOperationStatusesNextSinglePageAsync * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if 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}. + * @return a list of all import update operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listOperationStatusesNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listOperationStatusesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); + Response res + = service.listOperationStatusesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -7051,9 +7311,8 @@ private PagedResponse listOperationStatusesNextSinglePage(String nex private Mono> listLogCollectionsNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listLogCollectionsNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) + return FluxUtil.withContext( + context -> service.listLogCollectionsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -7091,8 +7350,8 @@ private Mono> listLogCollectionsNextSinglePageAsync(St @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listLogCollectionsNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listLogCollectionsNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); + Response res + = service.listLogCollectionsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } @@ -7130,9 +7389,8 @@ private PagedResponse listLogCollectionsNextSinglePage(String nextLi private Mono> listHealthOfDevicesNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listHealthOfDevicesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) + return FluxUtil.withContext( + context -> service.listHealthOfDevicesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); } @@ -7170,8 +7428,8 @@ private Mono> listHealthOfDevicesNextSinglePageAsync(S private PagedResponse listHealthOfDevicesNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listHealthOfDevicesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); + Response res + = service.listHealthOfDevicesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } 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 deleted file mode 100644 index d103cbc76d70..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java +++ /dev/null @@ -1,7115 +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.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -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.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -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 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. */ -public final class DeviceManagementsImpl { - /** The proxy service used to perform REST calls. */ - private final DeviceManagementsService service; - - /** 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) { - this.service - = RestProxy.create(DeviceManagementsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * 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") - public interface DeviceManagementsService { - @Get("/deviceUpdate/{instanceId}/management/deviceClasses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceClasses") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Patch("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Patch("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/devices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/devices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Post("/deviceUpdate/{instanceId}/management/devices:import") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Post("/deviceUpdate/{instanceId}/management/devices:import") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/updateCompliance") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/updateCompliance") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") - @ExpectedResponses({ 204 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:cancel") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:cancel") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:retry") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Post("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}:retry") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/status") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/status") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/devicestates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}/devicestates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Put("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Put("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/deviceHealth") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/deviceHealth") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceClassesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listDeviceClassesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listInstallableUpdatesForDeviceClassNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listInstallableUpdatesForDeviceClassNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDevicesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listDevicesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listGroupsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listGroupsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listBestUpdatesForGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listBestUpdatesForGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeploymentsForGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listDeploymentsForGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceClassSubgroupsForGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listDeviceClassSubgroupsForGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeploymentsForDeviceClassSubgroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listDeploymentsForDeviceClassSubgroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceStatesForDeviceClassSubgroupDeploymentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listDeviceStatesForDeviceClassSubgroupDeploymentNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listOperationStatusesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listOperationStatusesNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listLogCollectionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listLogCollectionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listHealthOfDevicesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listHealthOfDevicesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @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}. - */ - @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)) - .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 - * - * - * - * - * - *
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
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeviceClassesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listDeviceClassesSinglePageAsync(requestOptions), - nextLink -> listDeviceClassesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @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}. - */ - @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); - 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 - * - * - * - * - * - *
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
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceClasses(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listDeviceClassesSinglePage(requestOptions), - nextLink -> listDeviceClassesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets the properties of a device class. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 properties of a device class along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Gets the properties of a device class. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 properties of a device class along with {@link Response}. - */ - @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); - } - - /** - * Update device class details. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     friendlyName: String (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @param deviceClassId Device class identifier. - * @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. - * @throws ResourceNotFoundException thrown if 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 metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDeviceClassWithResponseAsync(String deviceClassId, - BinaryData deviceClassPatch, RequestOptions requestOptions) { - 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)); - } - - /** - * Update device class details. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     friendlyName: String (Required)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @param deviceClassId Device class identifier. - * @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. - * @throws ResourceNotFoundException thrown if 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 metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateDeviceClassWithResponse(String deviceClassId, BinaryData deviceClassPatch, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.updateDeviceClassSync(this.client.getEndpoint(), this.client.getInstanceId(), deviceClassId, - this.client.getServiceVersion().getVersion(), deviceClassPatch, accept, 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. - * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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> 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)); - } - - /** - * 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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 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); - } - - /** - * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstallableUpdatesForDeviceClassSinglePageAsync(String deviceClassId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listInstallableUpdatesForDeviceClass(this.client.getEndpoint(), - this.client.getInstanceId(), deviceClassId, this.client.getServiceVersion().getVersion(), 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 installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstallableUpdatesForDeviceClassAsync(String deviceClassId, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listInstallableUpdatesForDeviceClassSinglePageAsync(deviceClassId, requestOptions), - nextLink -> listInstallableUpdatesForDeviceClassNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets a list of installable updates for a device class. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - 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
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstallableUpdatesForDeviceClass(String deviceClassId, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listInstallableUpdatesForDeviceClassSinglePage(deviceClassId, requestOptions), - nextLink -> listInstallableUpdatesForDeviceClassNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets a list of devices connected to Device Update for IoT Hub. - * - *

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).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: 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 along with {@link PagedResponse} on successful - * 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)) - .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
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
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: 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 PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDevicesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listDevicesSinglePageAsync(requestOptions), - nextLink -> listDevicesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets a list of devices connected to Device Update for IoT Hub. - * - *

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).
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: 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 along with {@link PagedResponse}. - */ - @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); - 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
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
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDevices(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listDevicesSinglePage(requestOptions), - nextLink -> listDevicesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * 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 Response} on successful completion of {@link Mono}. - */ - @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)); - } - - /** - * 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 Response}. - */ - @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); - } - - /** - * 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 beginImportDevicesAsync(BinaryData importType, - 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 - ? requestOptions.getContext() - : Context.NONE), - 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
-     * 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 beginImportDevices(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)), - 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
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @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}. - */ - @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)); - } - - /** - * 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)
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @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}. - */ - @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); - } - - /** - * 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)
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @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. - * @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 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)); - } - - /** - * 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)
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @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. - * @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 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); - } - - /** - * 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}. - */ - @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)); - } - - /** - * 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}. - */ - @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); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @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 groups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)) - .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 - * - * - * - * - * - *
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
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @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 groups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listGroupsAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listGroupsSinglePageAsync(requestOptions), - nextLink -> listGroupsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @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 groups along with {@link PagedResponse}. - */ - @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); - 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 - * - * - * - * - * - *
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
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @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 groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGroups(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listGroupsSinglePage(requestOptions), - nextLink -> listGroupsNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets the device group properties. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @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 device group properties along with {@link Response} on successful completion of {@link Mono}. - */ - @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)); - } - - /** - * Gets the device group properties. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @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 device group properties along with {@link Response}. - */ - @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); - } - - /** - * 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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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> 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)); - } - - /** - * 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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 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); - } - - /** - * 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}. - */ - @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)); - } - - /** - * 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}. - */ - @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); - } - - /** - * 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)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
-     *         }
-     *         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 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)) - .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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBestUpdatesForGroupAsync(String groupId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listBestUpdatesForGroupSinglePageAsync(groupId, requestOptions), - nextLink -> listBestUpdatesForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
-     *         }
-     *         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 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); - 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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBestUpdatesForGroup(String groupId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listBestUpdatesForGroupSinglePage(groupId, requestOptions), - nextLink -> listBestUpdatesForGroupNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets a list of deployments for a device group. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 a list of deployments for a device group along with {@link PagedResponse} on successful completion of - * {@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)) - .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
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 a list of deployments for a device group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeploymentsForGroupAsync(String groupId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listDeploymentsForGroupSinglePageAsync(groupId, requestOptions), - nextLink -> listDeploymentsForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets a list of deployments for a device group. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 a list of deployments for a device group along with {@link PagedResponse}. - */ - @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); - 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
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 a list of deployments for a device group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listDeploymentsForGroupSinglePage(groupId, requestOptions), - nextLink -> listDeploymentsForGroupNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * Creates or updates a deployment. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateDeploymentWithResponseAsync(String groupId, String deploymentId, - BinaryData deployment, RequestOptions requestOptions) { - 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)); - } - - /** - * Creates or updates a deployment. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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. - * - * @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) { - final String accept = "application/json"; - return service.deleteDeploymentSync(this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deploymentId, this.client.getServiceVersion().getVersion(), 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
-     * {
-     *     groupId: String (Required)
-     *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled) (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)
-     *     }
-     *     subgroupStatus (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             deviceClassId: String (Required)
-     *             deploymentState: String(Active/Failed/Inactive/Canceled) (Required)
-     *             error (Optional): (recursive schema, see error above)
-     *             totalDevices: Integer (Optional)
-     *             devicesInProgressCount: Integer (Optional)
-     *             devicesCompletedFailedCount: Integer (Optional)
-     *             devicesCompletedSucceededCount: Integer (Optional)
-     *             devicesCanceledCount: Integer (Optional)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @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 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)); - } - - /** - * 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)
-     *     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)
-     *     }
-     *     subgroupStatus (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             deviceClassId: String (Required)
-     *             deploymentState: String(Active/Failed/Inactive/Canceled) (Required)
-     *             error (Optional): (recursive schema, see error above)
-     *             totalDevices: Integer (Optional)
-     *             devicesInProgressCount: Integer (Optional)
-     *             devicesCompletedFailedCount: Integer (Optional)
-     *             devicesCompletedSucceededCount: Integer (Optional)
-     *             devicesCanceledCount: Integer (Optional)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @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 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); - } - - /** - * 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')
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceClassSubgroupsForGroupSinglePageAsync(String groupId, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeviceClassSubgroupsForGroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, this.client.getServiceVersion().getVersion(), 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 - * - * - * - * - * - *
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
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeviceClassSubgroupsForGroupAsync(String groupId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listDeviceClassSubgroupsForGroupSinglePageAsync(groupId, requestOptions), - nextLink -> listDeviceClassSubgroupsForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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')
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - 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 - * - * - * - * - * - *
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
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceClassSubgroupsForGroup(String groupId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listDeviceClassSubgroupsForGroupSinglePage(groupId, requestOptions), - nextLink -> listDeviceClassSubgroupsForGroupNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * 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)
-     *     createdDateTime: String (Required)
-     *     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. - * @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 class subgroup details along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * 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)
-     *     createdDateTime: String (Required)
-     *     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. - * @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 class subgroup details along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * 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. - * @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> 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)); - } - - /** - * 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. - * @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 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); - } - - /** - * 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. - * @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 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, - 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
-     * {
-     *     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. - * @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 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, - 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
-     * {
-     *     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)
-     * }
-     * }
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @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, - 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
-     * {
-     *     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)
-     * }
-     * }
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @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); - } - - /** - * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsForDeviceClassSubgroupSinglePageAsync(String groupId, - String deviceClassId, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeploymentsForDeviceClassSubgroup(this.client.getEndpoint(), - this.client.getInstanceId(), groupId, deviceClassId, this.client.getServiceVersion().getVersion(), - 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 class subgroup. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeploymentsForDeviceClassSubgroupAsync(String groupId, String deviceClassId, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listDeploymentsForDeviceClassSubgroupSinglePageAsync(groupId, deviceClassId, requestOptions), - nextLink -> listDeploymentsForDeviceClassSubgroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets a list of deployments for a device class subgroup. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDeploymentsForDeviceClassSubgroupSinglePage(String groupId, - 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, - 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 class subgroup. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>( - () -> listDeploymentsForDeviceClassSubgroupSinglePage(groupId, deviceClassId, requestOptions), - nextLink -> listDeploymentsForDeviceClassSubgroupNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeploymentForDeviceClassSubgroupWithResponseAsync(String groupId, - 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)); - } - - /** - * Gets the deployment properties. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment properties along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Stops a deployment. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * Retries a deployment with failed devices. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Retries a deployment with failed devices. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 deployment metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * 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)
-     *     deploymentState: String(Active/Failed/Inactive/Canceled) (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)
-     *     }
-     *     totalDevices: Integer (Optional)
-     *     devicesInProgressCount: Integer (Optional)
-     *     devicesCompletedFailedCount: Integer (Optional)
-     *     devicesCompletedSucceededCount: Integer (Optional)
-     *     devicesCanceledCount: Integer (Optional)
-     * }
-     * }
- * - * @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 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)); - } - - /** - * 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)
-     *     deploymentState: String(Active/Failed/Inactive/Canceled) (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)
-     *     }
-     *     totalDevices: Integer (Optional)
-     *     devicesInProgressCount: Integer (Optional)
-     *     devicesCompletedFailedCount: Integer (Optional)
-     *     devicesCompletedSucceededCount: Integer (Optional)
-     *     devicesCanceledCount: Integer (Optional)
-     * }
-     * }
- * - * @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 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); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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. - * @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 in a deployment along with their state along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceStatesForDeviceClassSubgroupDeploymentSinglePageAsync( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - 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)) - .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 - * - * - * - * - * - *
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
-     * {
-     *     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. - * @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 in a deployment along with their state as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeviceStatesForDeviceClassSubgroupDeploymentAsync(String groupId, - String deviceClassId, String deploymentId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>( - () -> listDeviceStatesForDeviceClassSubgroupDeploymentSinglePageAsync(groupId, deviceClassId, deploymentId, - requestOptions), - nextLink -> listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePageAsync(nextLink, - requestOptionsForNextPage)); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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. - * @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 in a deployment along with their state along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDeviceStatesForDeviceClassSubgroupDeploymentSinglePage(String groupId, - 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); - 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 - * - * - * - * - * - *
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
-     * {
-     *     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. - * @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 in a deployment along with their state as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceStatesForDeviceClassSubgroupDeployment(String groupId, - String deviceClassId, String deploymentId, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>( - () -> listDeviceStatesForDeviceClassSubgroupDeploymentSinglePage(groupId, deviceClassId, deploymentId, - requestOptions), - nextLink -> listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePage(nextLink, - requestOptionsForNextPage)); - } - - /** - * Retrieve operation status. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Retrieve operation status. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response}. - */ - @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); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @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)) - .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 - * - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationStatusesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listOperationStatusesSinglePageAsync(requestOptions), - nextLink -> listOperationStatusesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - 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 - * - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listOperationStatusesSinglePage(requestOptions), - nextLink -> listOperationStatusesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Start the device diagnostics log collection on specified devices. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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. - * @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 diagnostics request body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startLogCollectionWithResponseAsync(String logCollectionId, - BinaryData logCollection, RequestOptions requestOptions) { - 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)); - } - - /** - * Start the device diagnostics log collection on specified devices. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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. - * @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 diagnostics request body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startLogCollectionWithResponse(String logCollectionId, BinaryData logCollection, - RequestOptions requestOptions) { - final String accept = "application/json"; - return service.startLogCollectionSync(this.client.getEndpoint(), this.client.getInstanceId(), logCollectionId, - this.client.getServiceVersion().getVersion(), logCollection, accept, requestOptions, Context.NONE); - } - - /** - * Get the device diagnostics log collection. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @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)); - } - - /** - * Get the device diagnostics log collection. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @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); - } - - /** - * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @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)) - .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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listLogCollectionsAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listLogCollectionsSinglePageAsync(requestOptions), - nextLink -> listLogCollectionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - 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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLogCollections(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listLogCollectionsSinglePage(requestOptions), - nextLink -> listLogCollectionsNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get log collection with detailed status. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     operationId: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
-     *     deviceStatus (Optional): [
-     *          (Optional){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             resultCode: String (Optional)
-     *             extendedResultCode: String (Optional)
-     *             logLocation: String (Optional)
-     *         }
-     *     ]
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 log collection with detailed status along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Get log collection with detailed status. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     operationId: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
-     *     deviceStatus (Optional): [
-     *          (Optional){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             resultCode: String (Optional)
-     *             extendedResultCode: String (Optional)
-     *             logLocation: String (Optional)
-     *         }
-     *     ]
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 log collection with detailed status along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * Get list of device health. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @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. - * @throws ResourceNotFoundException thrown if 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 device health along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHealthOfDevicesSinglePageAsync(String filter, - 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)) - .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
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @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. - * @throws ResourceNotFoundException thrown if 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 device health as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHealthOfDevicesAsync(String filter, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listHealthOfDevicesSinglePageAsync(filter, requestOptions), - nextLink -> listHealthOfDevicesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get list of device health. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @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. - * @throws ResourceNotFoundException thrown if 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 device health along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - 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
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @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. - * @throws ResourceNotFoundException thrown if 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 device health as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHealthOfDevices(String filter, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listHealthOfDevicesSinglePage(filter, requestOptions), - nextLink -> listHealthOfDevicesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceClassesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeviceClassesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDeviceClassesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listDeviceClassesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     updateId (Required): {
-     *         provider: String (Required)
-     *         name: String (Required)
-     *         version: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     friendlyName: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listInstallableUpdatesForDeviceClassNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listInstallableUpdatesForDeviceClassNext(nextLink, - this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     updateId (Required): {
-     *         provider: String (Required)
-     *         name: String (Required)
-     *         version: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     friendlyName: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listInstallableUpdatesForDeviceClassNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listInstallableUpdatesForDeviceClassNextSync(nextLink, - this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDevicesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listDevicesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDevicesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listDevicesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listGroupsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listGroupsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listGroupsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listGroupsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBestUpdatesForGroupNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listBestUpdatesForGroupNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listBestUpdatesForGroupNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listBestUpdatesForGroupNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsForGroupNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeploymentsForGroupNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDeploymentsForGroupNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listDeploymentsForGroupNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceClassId: String (Required)
-     *     groupId: String (Required)
-     *     createdDateTime: String (Required)
-     *     deviceCount: Integer (Optional)
-     *     deploymentId: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceClassSubgroupsForGroupNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeviceClassSubgroupsForGroupNext(nextLink, this.client.getEndpoint(), - accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceClassId: String (Required)
-     *     groupId: String (Required)
-     *     createdDateTime: String (Required)
-     *     deviceCount: Integer (Optional)
-     *     deploymentId: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDeviceClassSubgroupsForGroupNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listDeviceClassSubgroupsForGroupNextSync(nextLink, this.client.getEndpoint(), - accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsForDeviceClassSubgroupNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeploymentsForDeviceClassSubgroupNext(nextLink, - this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDeploymentsForDeviceClassSubgroupNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listDeploymentsForDeviceClassSubgroupNextSync(nextLink, - this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceId: String (Required)
-     *     moduleId: String (Optional)
-     *     retryCount: int (Required)
-     *     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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePageAsync( - String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listDeviceStatesForDeviceClassSubgroupDeploymentNext(nextLink, - this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     deviceId: String (Required)
-     *     moduleId: String (Optional)
-     *     retryCount: int (Required)
-     *     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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listDeviceStatesForDeviceClassSubgroupDeploymentNextSync(nextLink, - this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationStatusesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOperationStatusesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listOperationStatusesNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listOperationStatusesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLogCollectionsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listLogCollectionsNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listLogCollectionsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listLogCollectionsNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listHealthOfDevicesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listHealthOfDevicesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listHealthOfDevicesNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listHealthOfDevicesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} 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..78968fb4334d 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,21 +1,69 @@ // 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.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; 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.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +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.http.rest.RestProxy; +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.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; +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; -/** 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 proxy service used to perform REST calls. + */ + private final DeviceUpdateClientService service; + + /** + * The Device Update for IoT Hub account endpoint (hostname only, no protocol). + */ private final String endpoint; /** @@ -27,7 +75,9 @@ 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; /** @@ -39,7 +89,9 @@ public String getInstanceId() { return this.instanceId; } - /** Service version. */ + /** + * Service version. + */ private final DeviceUpdateServiceVersion serviceVersion; /** @@ -51,7 +103,9 @@ public DeviceUpdateServiceVersion getServiceVersion() { return this.serviceVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** @@ -63,7 +117,9 @@ 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; /** @@ -75,30 +131,6 @@ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** 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. */ - private final DeviceManagementsImpl deviceManagements; - - /** - * Gets the DeviceManagementsImpl object to access its operations. - * - * @return the DeviceManagementsImpl object. - */ - public DeviceManagementsImpl getDeviceManagements() { - return this.deviceManagements; - } - /** * Initializes an instance of DeviceUpdateClient client. * @@ -107,7 +139,7 @@ public DeviceManagementsImpl getDeviceManagements() { * @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); } @@ -140,7 +172,3184 @@ public DeviceUpdateClientImpl(HttpPipeline httpPipeline, SerializerAdapter seria this.endpoint = endpoint; this.instanceId = instanceId; this.serviceVersion = serviceVersion; - this.deviceUpdates = new DeviceUpdatesImpl(this); - this.deviceManagements = new DeviceManagementsImpl(this); + this.service + = RestProxy.create(DeviceUpdateClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for DeviceUpdateClient to be used by the proxy service to perform REST + * calls. + */ + @Host("https://{endpoint}") + @ServiceInterface(name = "DeviceUpdateClient") + public interface DeviceUpdateClientService { + + @Get("/deviceUpdate/{instanceId}/updates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listUpdates(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/deviceUpdate/{instanceId}/updates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listUpdatesSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> importUpdate(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response importUpdateSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getUpdate(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getUpdateSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteUpdate(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteUpdateSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listProviders(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/deviceUpdate/{instanceId}/updates/providers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listProvidersSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNames(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listNamesSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listVersions(@HostParam("endpoint") String endpoint, + @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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listVersionsSync(@HostParam("endpoint") String endpoint, + @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") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listFiles(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listFilesSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFile(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getFileSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listOperationStatuses(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/deviceUpdate/{instanceId}/updates/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listOperationStatusesSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOperationStatus(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getOperationStatusSync(@HostParam("endpoint") String endpoint, + @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 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listUpdatesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listUpdatesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listProvidersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listProvidersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNamesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listNamesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listVersionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listVersionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listFilesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listFilesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listOperationStatusesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listOperationStatusesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + *

Query Parameters

+ * + * + * + * + * + *
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
+     * {
+     *     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 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUpdatesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listUpdates(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
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
+     * {
+     *     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 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUpdatesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listUpdatesSinglePageAsync(requestOptions), + nextLink -> listUpdatesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + *

Query Parameters

+ * + * + * + * + * + *
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
+     * {
+     *     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 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listUpdatesSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listUpdatesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
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
+     * {
+     *     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 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdates(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listUpdatesSinglePage(requestOptions), + nextLink -> listUpdatesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * 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 update metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
+     * [
+     *      (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 update metadata along with {@link Response}. + */ + @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.getEndpoint(), this.getServiceVersion().getVersion(), this.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
+     * [
+     *      (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 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.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.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.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.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 PollerFlux} for polling of update metadata. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportUpdateAsync(BinaryData updateToImport, + RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.importUpdateWithResponseAsync(updateToImport, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.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
+     * [
+     *      (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 beginImportUpdate(BinaryData updateToImport, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.importUpdateWithResponse(updateToImport, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * Get a specific update version. + *

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.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

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 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 a specific update version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getUpdateWithResponseAsync(String provider, String name, String version, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getUpdate(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), provider, name, version, accept, requestOptions, context)); + } + + /** + * Get a specific update version. + *

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.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

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 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 a specific update version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateWithResponse(String provider, String name, String version, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getUpdateSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.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. + * + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteUpdateWithResponseAsync(String provider, String name, String version, + RequestOptions requestOptions) { + return FluxUtil + .withContext(context -> service.deleteUpdate(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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. + * + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteUpdateWithResponse(String provider, String name, String version, + RequestOptions requestOptions) { + return service.deleteUpdateSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.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. + * + * @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 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.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.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.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.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 DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.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 beginDeleteUpdate(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.getHttpPipeline()) + .setEndpoint("https://{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listProvidersSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listProviders(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
+     * 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProvidersAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listProvidersSinglePageAsync(requestOptions), + nextLink -> listProvidersNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listProvidersSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listProvidersSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
+     * 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listProviders(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listProvidersSinglePage(requestOptions), + nextLink -> listProvidersNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update names that match the specified provider. + *

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 along with {@link PagedResponse} on + * 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
+     * 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNamesAsync(String provider, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listNamesSinglePageAsync(provider, requestOptions), + nextLink -> listNamesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update names that match the specified provider. + *

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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNamesSinglePage(String provider, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listNamesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
+     * 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}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNames(String provider, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listNamesSinglePage(provider, requestOptions), + nextLink -> listNamesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update versions that match the specified provider and name. + *

Query Parameters

+ * + * + * + * + *
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
+     * String
+     * }
+     * 
+ * + * @param provider Update provider. + * @param name Update name. + * @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 versions that match the specified provider and name along with {@link PagedResponse} + * 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

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. + * @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 versions that match the specified provider and name as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersionsAsync(String provider, String name, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listVersionsSinglePageAsync(provider, name, requestOptions), + nextLink -> listVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update versions that match the specified provider and name. + *

Query Parameters

+ * + * + * + * + *
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
+     * String
+     * }
+     * 
+ * + * @param provider Update provider. + * @param name Update name. + * @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 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

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. + * @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 versions that match the specified provider and name as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listVersionsSinglePage(provider, name, requestOptions), + nextLink -> listVersionsNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update file identifiers for the specified version. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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> listFilesSinglePageAsync(String provider, String name, String version, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listFiles(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
+     * String
+     * }
+     * 
+ * + * @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 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, + RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listFilesSinglePageAsync(provider, name, version, requestOptions), + nextLink -> listFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update file identifiers for the specified version. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 a list of all update file identifiers for the specified version along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listFilesSinglePage(String provider, String name, String version, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listFilesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.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
+     * String
+     * }
+     * 
+ * + * @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 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, + RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listFilesSinglePage(provider, name, version, requestOptions), + nextLink -> listFilesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a specific update file from the version. + *

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.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     sizeInBytes: long (Required)
+     *     hashes (Required): {
+     *         String: String (Required)
+     *     }
+     *     mimeType: String (Optional)
+     *     scanResult: String (Optional)
+     *     scanDetails: String (Optional)
+     *     properties (Optional): {
+     *         String: String (Required)
+     *     }
+     *     fileId: String (Required)
+     *     relatedFiles (Optional): [
+     *          (Optional){
+     *             fileName: String (Required)
+     *             sizeInBytes: long (Required)
+     *             hashes (Required): {
+     *                 String: String (Required)
+     *             }
+     *             mimeType: String (Optional)
+     *             scanResult: String (Optional)
+     *             scanDetails: String (Optional)
+     *             properties (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     downloadHandler (Optional): {
+     *         id: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File 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 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.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), provider, name, version, fileId, accept, requestOptions, context)); + } + + /** + * Get a specific update file from the version. + *

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.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     fileName: String (Required)
+     *     sizeInBytes: long (Required)
+     *     hashes (Required): {
+     *         String: String (Required)
+     *     }
+     *     mimeType: String (Optional)
+     *     scanResult: String (Optional)
+     *     scanDetails: String (Optional)
+     *     properties (Optional): {
+     *         String: String (Required)
+     *     }
+     *     fileId: String (Required)
+     *     relatedFiles (Optional): [
+     *          (Optional){
+     *             fileName: String (Required)
+     *             sizeInBytes: long (Required)
+     *             hashes (Required): {
+     *                 String: String (Required)
+     *             }
+     *             mimeType: String (Optional)
+     *             scanResult: String (Optional)
+     *             scanDetails: String (Optional)
+     *             properties (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     downloadHandler (Optional): {
+     *         id: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File 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 a specific update file from the version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse(String provider, String name, String version, String fileId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getFileSync(this.getEndpoint(), this.getServiceVersion().getVersion(), this.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

+ * + * + * + * + * + *
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
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listOperationStatusesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listOperationStatuses(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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

+ * + * + * + * + * + *
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
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationStatusesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listOperationStatusesSinglePageAsync(requestOptions), + nextLink -> listOperationStatusesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * 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.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listOperationStatusesSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listOperationStatusesSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.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

+ * + * + * + * + * + *
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
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperationStatuses(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listOperationStatusesSinglePage(requestOptions), + nextLink -> listOperationStatusesNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Retrieve operation status. + *

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.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationStatusWithResponseAsync(String operationId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getOperationStatus(this.getEndpoint(), + this.getServiceVersion().getVersion(), this.getInstanceId(), operationId, accept, requestOptions, context)); + } + + /** + * Retrieve operation status. + *

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.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getOperationStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + this.getInstanceId(), operationId, accept, requestOptions, Context.NONE); + } + + /** + * Get the next page of items. + *

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 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 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, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listUpdatesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

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 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 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) { + final String accept = "application/json"; + Response res + = service.listUpdatesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listProvidersNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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) { + final String accept = "application/json"; + Response res + = service.listProvidersNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listNamesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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) { + final String accept = "application/json"; + Response res + = service.listNamesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listVersionsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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) { + final String accept = "application/json"; + Response res + = service.listVersionsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listFilesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * String
+     * }
+     * 
+ * + * @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 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) { + final String accept = "application/json"; + Response res + = service.listFilesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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 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, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listOperationStatusesNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     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)
+     * }
+     * }
+     * 
+ * + * @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 a list of all import update operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listOperationStatusesNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/json"; + Response res + = service.listOperationStatusesNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } } } 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 deleted file mode 100644 index 204b3f4c3e71..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java +++ /dev/null @@ -1,2897 +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.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -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.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -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 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. */ -public final class DeviceUpdatesImpl { - /** The proxy service used to perform REST calls. */ - private final DeviceUpdatesService service; - - /** 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) { - this.service - = RestProxy.create(DeviceUpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * 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") - public interface DeviceUpdatesService { - @Get("/deviceUpdate/{instanceId}/updates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Post("/deviceUpdate/{instanceId}/updates:import") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Post("/deviceUpdate/{instanceId}/updates:import") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listUpdatesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listUpdatesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listProvidersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listProvidersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNamesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listNamesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listVersionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listVersionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listFilesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listFilesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listOperationStatusesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listOperationStatusesNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * - * - * - * - * - * - *
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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 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)) - .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
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUpdatesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listUpdatesSinglePageAsync(requestOptions), - nextLink -> listUpdatesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all updates that have been imported to Device Update for IoT Hub. - * - *

Query Parameters - * - * - * - * - * - * - *
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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 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); - 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
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUpdates(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listUpdatesSinglePage(requestOptions), - nextLink -> listUpdatesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * 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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 update metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> importUpdateWithResponseAsync(BinaryData updateToImport, - RequestOptions requestOptions) { - 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)); - } - - /** - * 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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 update metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response importUpdateWithResponse(BinaryData updateToImport, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.importUpdateSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), updateToImport, accept, 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
-     * [
-     *      (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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 PollerFlux} for polling of update metadata. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginImportUpdateAsync(BinaryData updateToImport, - 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 - ? requestOptions.getContext() - : Context.NONE), - 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
-     * [
-     *      (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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 beginImportUpdate(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)), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Get a specific update version. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
- * - * @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 a specific update version along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Get a specific update version. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
- * - * @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 a specific update version along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * 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 Response} on successful completion of {@link Mono}. - */ - @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)); - } - - /** - * 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 Response}. - */ - @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); - } - - /** - * 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 - ? requestOptions.getContext() - : Context.NONE), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.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 beginDeleteUpdate(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)), - TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * 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}. - */ - @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)) - .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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProvidersAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listProvidersSinglePageAsync(requestOptions), - nextLink -> listProvidersNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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}. - */ - @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); - 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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProviders(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listProvidersSinglePage(requestOptions), - nextLink -> listProvidersNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update names that match the specified provider. - * - *

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 along with {@link PagedResponse} on - * 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)) - .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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNamesAsync(String provider, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listNamesSinglePageAsync(provider, requestOptions), - nextLink -> listNamesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update names that match the specified provider. - * - *

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 along with {@link PagedResponse}. - */ - @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); - 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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNames(String provider, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listNamesSinglePage(provider, requestOptions), - nextLink -> listNamesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * String
-     * }
- * - * @param provider Update provider. - * @param name Update name. - * @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 versions that match the specified provider and name along with {@link PagedResponse} - * 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)) - .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
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

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. - * @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 versions that match the specified provider and name as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVersionsAsync(String provider, String name, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listVersionsSinglePageAsync(provider, name, requestOptions), - nextLink -> listVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update versions that match the specified provider and name. - * - *

Query Parameters - * - * - * - * - * - *
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
-     * String
-     * }
- * - * @param provider Update provider. - * @param name Update name. - * @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 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); - 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
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

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. - * @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 versions that match the specified provider and name as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listVersionsSinglePage(provider, name, requestOptions), - nextLink -> listVersionsNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
-     * String
-     * }
- * - * @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 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> 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)) - .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
-     * String
-     * }
- * - * @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 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, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listFilesSinglePageAsync(provider, name, version, requestOptions), - nextLink -> listFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update file identifiers for the specified version. - * - *

Response Body Schema - * - *

{@code
-     * String
-     * }
- * - * @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 a list of all update file identifiers for the specified version along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listFilesSinglePage(String provider, String name, String version, - 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); - 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
-     * String
-     * }
- * - * @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 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, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listFilesSinglePage(provider, name, version, requestOptions), - nextLink -> listFilesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a specific update file from the version. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     fileName: String (Required)
-     *     sizeInBytes: long (Required)
-     *     hashes (Required): {
-     *         String: String (Required)
-     *     }
-     *     mimeType: String (Optional)
-     *     scanResult: String (Optional)
-     *     scanDetails: String (Optional)
-     *     properties (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     fileId: String (Required)
-     *     relatedFiles (Optional): [
-     *          (Optional){
-     *             fileName: String (Required)
-     *             sizeInBytes: long (Required)
-     *             hashes (Required): {
-     *                 String: String (Required)
-     *             }
-     *             mimeType: String (Optional)
-     *             scanResult: String (Optional)
-     *             scanDetails: String (Optional)
-     *             properties (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *         }
-     *     ]
-     *     downloadHandler (Optional): {
-     *         id: String (Required)
-     *     }
-     *     etag: String (Optional)
-     * }
-     * }
- * - * @param provider Update provider. - * @param name Update name. - * @param version Update version. - * @param fileId File 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 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)); - } - - /** - * Get a specific update file from the version. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     fileName: String (Required)
-     *     sizeInBytes: long (Required)
-     *     hashes (Required): {
-     *         String: String (Required)
-     *     }
-     *     mimeType: String (Optional)
-     *     scanResult: String (Optional)
-     *     scanDetails: String (Optional)
-     *     properties (Optional): {
-     *         String: String (Optional)
-     *     }
-     *     fileId: String (Required)
-     *     relatedFiles (Optional): [
-     *          (Optional){
-     *             fileName: String (Required)
-     *             sizeInBytes: long (Required)
-     *             hashes (Required): {
-     *                 String: String (Required)
-     *             }
-     *             mimeType: String (Optional)
-     *             scanResult: String (Optional)
-     *             scanDetails: String (Optional)
-     *             properties (Optional): {
-     *                 String: String (Optional)
-     *             }
-     *         }
-     *     ]
-     *     downloadHandler (Optional): {
-     *         id: String (Required)
-     *     }
-     *     etag: String (Optional)
-     * }
-     * }
- * - * @param provider Update provider. - * @param name Update name. - * @param version Update version. - * @param fileId File 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 a specific update file from the version along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @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)) - .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 - * - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationStatusesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listOperationStatusesSinglePageAsync(requestOptions), - nextLink -> listOperationStatusesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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.
- * - * You can add these to a request with {@link RequestOptions#addQueryParam} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - 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 - * - * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
- * - * @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listOperationStatusesSinglePage(requestOptions), - nextLink -> listOperationStatusesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Retrieve operation status. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Retrieve operation status. - * - *

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.
- * - * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response}. - */ - @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); - } - - /** - * Get the next page of items. - * - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listUpdatesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listUpdatesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listUpdatesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listUpdatesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listProvidersNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listProvidersNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listProvidersNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listProvidersNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNamesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNamesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNamesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listNamesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listVersionsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listVersionsNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listVersionsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listFilesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listFilesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

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

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listFilesNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listFilesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listOperationStatusesNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOperationStatusesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     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)
-     * }
-     * }
- * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listOperationStatusesNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listOperationStatusesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} 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/swagger/src/main/java/com/azure/iot/deviceupdate/package-info.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/package-info.java similarity index 79% rename from sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/package-info.java rename to sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/package-info.java index a240d67ed2e8..8e0a6d8bb0fa 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/package-info.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/models/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. + * 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; +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..2b39db8c6a48 --- /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":"13bbaebc5a28","crossLanguageDefinitions":{"com.azure.iot.deviceupdate.DeviceManagementAsyncClient":"Customization.DeviceManagementClient","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.beginImportDevices":"Customization.DeviceManagementClient.importDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.beginImportDevicesWithModel":"Customization.DeviceManagementClient.importDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.createOrUpdateDeployment":"Customization.DeviceManagementClient.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.createOrUpdateDeploymentWithResponse":"Customization.DeviceManagementClient.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeployment":"Customization.DeviceManagementClient.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeploymentForDeviceClassSubgroup":"Customization.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeploymentForDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeploymentWithResponse":"Customization.DeviceManagementClient.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClass":"Customization.DeviceManagementClient.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClassSubgroup":"Customization.DeviceManagementClient.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteDeviceClassWithResponse":"Customization.DeviceManagementClient.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteGroup":"Customization.DeviceManagementClient.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.deleteGroupWithResponse":"Customization.DeviceManagementClient.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getBestUpdatesForDeviceClassSubgroup":"Customization.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getBestUpdatesForDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeployment":"Customization.DeviceManagementClient.getDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentForDeviceClassSubgroup":"Customization.DeviceManagementClient.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentForDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentStatus":"Customization.DeviceManagementClient.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentStatusWithResponse":"Customization.DeviceManagementClient.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeploymentWithResponse":"Customization.DeviceManagementClient.getDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDevice":"Customization.DeviceManagementClient.getDevice","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClass":"Customization.DeviceManagementClient.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroup":"Customization.DeviceManagementClient.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupDeploymentStatus":"Customization.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupDeploymentStatusWithResponse":"Customization.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupUpdateCompliance":"Customization.DeviceManagementClient.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupUpdateComplianceWithResponse":"Customization.DeviceManagementClient.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceClassWithResponse":"Customization.DeviceManagementClient.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceModule":"Customization.DeviceManagementClient.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceModuleWithResponse":"Customization.DeviceManagementClient.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getDeviceWithResponse":"Customization.DeviceManagementClient.getDevice","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getGroup":"Customization.DeviceManagementClient.getGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getGroupWithResponse":"Customization.DeviceManagementClient.getGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollection":"Customization.DeviceManagementClient.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollectionDetailedStatus":"Customization.DeviceManagementClient.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollectionDetailedStatusWithResponse":"Customization.DeviceManagementClient.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getLogCollectionWithResponse":"Customization.DeviceManagementClient.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getOperationStatus":"Customization.DeviceManagementClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getOperationStatusWithResponse":"Customization.DeviceManagementClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateCompliance":"Customization.DeviceManagementClient.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateComplianceForGroup":"Customization.DeviceManagementClient.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateComplianceForGroupWithResponse":"Customization.DeviceManagementClient.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.getUpdateComplianceWithResponse":"Customization.DeviceManagementClient.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listBestUpdatesForGroup":"Customization.DeviceManagementClient.listBestUpdatesForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeploymentsForDeviceClassSubgroup":"Customization.DeviceManagementClient.listDeploymentsForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeploymentsForGroup":"Customization.DeviceManagementClient.listDeploymentsForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeviceClassSubgroupsForGroup":"Customization.DeviceManagementClient.listDeviceClassSubgroupsForGroup","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeviceClasses":"Customization.DeviceManagementClient.listDeviceClasses","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDeviceStatesForDeviceClassSubgroupDeployment":"Customization.DeviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listDevices":"Customization.DeviceManagementClient.listDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listGroups":"Customization.DeviceManagementClient.listGroups","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listHealthOfDevices":"Customization.DeviceManagementClient.listHealthOfDevices","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listInstallableUpdatesForDeviceClass":"Customization.DeviceManagementClient.listInstallableUpdatesForDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listLogCollections":"Customization.DeviceManagementClient.listLogCollections","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.listOperationStatuses":"Customization.DeviceManagementClient.listOperationStatuses","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.retryDeployment":"Customization.DeviceManagementClient.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.retryDeploymentWithResponse":"Customization.DeviceManagementClient.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.startLogCollection":"Customization.DeviceManagementClient.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.startLogCollectionWithResponse":"Customization.DeviceManagementClient.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.stopDeployment":"Customization.DeviceManagementClient.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.stopDeploymentWithResponse":"Customization.DeviceManagementClient.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.updateDeviceClass":"Customization.DeviceManagementClient.updateDeviceClass","com.azure.iot.deviceupdate.DeviceManagementAsyncClient.updateDeviceClassWithResponse":"Customization.DeviceManagementClient.updateDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient":"Customization.DeviceManagementClient","com.azure.iot.deviceupdate.DeviceManagementClient.beginImportDevices":"Customization.DeviceManagementClient.importDevices","com.azure.iot.deviceupdate.DeviceManagementClient.beginImportDevicesWithModel":"Customization.DeviceManagementClient.importDevices","com.azure.iot.deviceupdate.DeviceManagementClient.createOrUpdateDeployment":"Customization.DeviceManagementClient.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.createOrUpdateDeploymentWithResponse":"Customization.DeviceManagementClient.createOrUpdateDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeployment":"Customization.DeviceManagementClient.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroup":"Customization.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.deleteDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeploymentWithResponse":"Customization.DeviceManagementClient.deleteDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClass":"Customization.DeviceManagementClient.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClassSubgroup":"Customization.DeviceManagementClient.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.deleteDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteDeviceClassWithResponse":"Customization.DeviceManagementClient.deleteDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.deleteGroup":"Customization.DeviceManagementClient.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementClient.deleteGroupWithResponse":"Customization.DeviceManagementClient.deleteGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroup":"Customization.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.getBestUpdatesForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeployment":"Customization.DeviceManagementClient.getDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentForDeviceClassSubgroup":"Customization.DeviceManagementClient.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.getDeploymentForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentStatus":"Customization.DeviceManagementClient.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentStatusWithResponse":"Customization.DeviceManagementClient.getDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeploymentWithResponse":"Customization.DeviceManagementClient.getDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.getDevice":"Customization.DeviceManagementClient.getDevice","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClass":"Customization.DeviceManagementClient.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroup":"Customization.DeviceManagementClient.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatus":"Customization.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse":"Customization.DeviceManagementClient.getDeviceClassSubgroupDeploymentStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupUpdateCompliance":"Customization.DeviceManagementClient.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupUpdateComplianceWithResponse":"Customization.DeviceManagementClient.getDeviceClassSubgroupUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassSubgroupWithResponse":"Customization.DeviceManagementClient.getDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceClassWithResponse":"Customization.DeviceManagementClient.getDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceModule":"Customization.DeviceManagementClient.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceModuleWithResponse":"Customization.DeviceManagementClient.getDeviceModule","com.azure.iot.deviceupdate.DeviceManagementClient.getDeviceWithResponse":"Customization.DeviceManagementClient.getDevice","com.azure.iot.deviceupdate.DeviceManagementClient.getGroup":"Customization.DeviceManagementClient.getGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getGroupWithResponse":"Customization.DeviceManagementClient.getGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollection":"Customization.DeviceManagementClient.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollectionDetailedStatus":"Customization.DeviceManagementClient.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollectionDetailedStatusWithResponse":"Customization.DeviceManagementClient.getLogCollectionDetailedStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getLogCollectionWithResponse":"Customization.DeviceManagementClient.getLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.getOperationStatus":"Customization.DeviceManagementClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getOperationStatusWithResponse":"Customization.DeviceManagementClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateCompliance":"Customization.DeviceManagementClient.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateComplianceForGroup":"Customization.DeviceManagementClient.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateComplianceForGroupWithResponse":"Customization.DeviceManagementClient.getUpdateComplianceForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.getUpdateComplianceWithResponse":"Customization.DeviceManagementClient.getUpdateCompliance","com.azure.iot.deviceupdate.DeviceManagementClient.listBestUpdatesForGroup":"Customization.DeviceManagementClient.listBestUpdatesForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeploymentsForDeviceClassSubgroup":"Customization.DeviceManagementClient.listDeploymentsForDeviceClassSubgroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeploymentsForGroup":"Customization.DeviceManagementClient.listDeploymentsForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeviceClassSubgroupsForGroup":"Customization.DeviceManagementClient.listDeviceClassSubgroupsForGroup","com.azure.iot.deviceupdate.DeviceManagementClient.listDeviceClasses":"Customization.DeviceManagementClient.listDeviceClasses","com.azure.iot.deviceupdate.DeviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment":"Customization.DeviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.listDevices":"Customization.DeviceManagementClient.listDevices","com.azure.iot.deviceupdate.DeviceManagementClient.listGroups":"Customization.DeviceManagementClient.listGroups","com.azure.iot.deviceupdate.DeviceManagementClient.listHealthOfDevices":"Customization.DeviceManagementClient.listHealthOfDevices","com.azure.iot.deviceupdate.DeviceManagementClient.listInstallableUpdatesForDeviceClass":"Customization.DeviceManagementClient.listInstallableUpdatesForDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.listLogCollections":"Customization.DeviceManagementClient.listLogCollections","com.azure.iot.deviceupdate.DeviceManagementClient.listOperationStatuses":"Customization.DeviceManagementClient.listOperationStatuses","com.azure.iot.deviceupdate.DeviceManagementClient.retryDeployment":"Customization.DeviceManagementClient.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.retryDeploymentWithResponse":"Customization.DeviceManagementClient.retryDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.startLogCollection":"Customization.DeviceManagementClient.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.startLogCollectionWithResponse":"Customization.DeviceManagementClient.startLogCollection","com.azure.iot.deviceupdate.DeviceManagementClient.stopDeployment":"Customization.DeviceManagementClient.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.stopDeploymentWithResponse":"Customization.DeviceManagementClient.stopDeployment","com.azure.iot.deviceupdate.DeviceManagementClient.updateDeviceClass":"Customization.DeviceManagementClient.updateDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClient.updateDeviceClassWithResponse":"Customization.DeviceManagementClient.updateDeviceClass","com.azure.iot.deviceupdate.DeviceManagementClientBuilder":"Customization.DeviceManagementClient","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient":"Customization.ClientDeviceUpdateClient","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginDeleteUpdate":"Customization.ClientDeviceUpdateClient.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginDeleteUpdateWithModel":"Customization.ClientDeviceUpdateClient.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginImportUpdate":"Customization.ClientDeviceUpdateClient.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.beginImportUpdateWithModel":"Customization.ClientDeviceUpdateClient.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getFile":"Customization.ClientDeviceUpdateClient.getFile","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getFileWithResponse":"Customization.ClientDeviceUpdateClient.getFile","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getOperationStatus":"Customization.ClientDeviceUpdateClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getOperationStatusWithResponse":"Customization.ClientDeviceUpdateClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getUpdate":"Customization.ClientDeviceUpdateClient.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.getUpdateWithResponse":"Customization.ClientDeviceUpdateClient.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listFiles":"Customization.ClientDeviceUpdateClient.listFiles","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listNames":"Customization.ClientDeviceUpdateClient.listNames","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listOperationStatuses":"Customization.ClientDeviceUpdateClient.listOperationStatuses","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listProviders":"Customization.ClientDeviceUpdateClient.listProviders","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listUpdates":"Customization.ClientDeviceUpdateClient.listUpdates","com.azure.iot.deviceupdate.DeviceUpdateAsyncClient.listVersions":"Customization.ClientDeviceUpdateClient.listVersions","com.azure.iot.deviceupdate.DeviceUpdateClient":"Customization.ClientDeviceUpdateClient","com.azure.iot.deviceupdate.DeviceUpdateClient.beginDeleteUpdate":"Customization.ClientDeviceUpdateClient.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.beginDeleteUpdateWithModel":"Customization.ClientDeviceUpdateClient.deleteUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.beginImportUpdate":"Customization.ClientDeviceUpdateClient.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.beginImportUpdateWithModel":"Customization.ClientDeviceUpdateClient.importUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.getFile":"Customization.ClientDeviceUpdateClient.getFile","com.azure.iot.deviceupdate.DeviceUpdateClient.getFileWithResponse":"Customization.ClientDeviceUpdateClient.getFile","com.azure.iot.deviceupdate.DeviceUpdateClient.getOperationStatus":"Customization.ClientDeviceUpdateClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateClient.getOperationStatusWithResponse":"Customization.ClientDeviceUpdateClient.getOperationStatus","com.azure.iot.deviceupdate.DeviceUpdateClient.getUpdate":"Customization.ClientDeviceUpdateClient.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.getUpdateWithResponse":"Customization.ClientDeviceUpdateClient.getUpdate","com.azure.iot.deviceupdate.DeviceUpdateClient.listFiles":"Customization.ClientDeviceUpdateClient.listFiles","com.azure.iot.deviceupdate.DeviceUpdateClient.listNames":"Customization.ClientDeviceUpdateClient.listNames","com.azure.iot.deviceupdate.DeviceUpdateClient.listOperationStatuses":"Customization.ClientDeviceUpdateClient.listOperationStatuses","com.azure.iot.deviceupdate.DeviceUpdateClient.listProviders":"Customization.ClientDeviceUpdateClient.listProviders","com.azure.iot.deviceupdate.DeviceUpdateClient.listUpdates":"Customization.ClientDeviceUpdateClient.listUpdates","com.azure.iot.deviceupdate.DeviceUpdateClient.listVersions":"Customization.ClientDeviceUpdateClient.listVersions","com.azure.iot.deviceupdate.DeviceUpdateClientBuilder":"Customization.ClientDeviceUpdateClient","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/DeviceManagementClientBuilder.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/DeviceUpdateServiceVersion.java","src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementClientImpl.java","src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.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/README.md b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/README.md index cacae4c41f8b..e09ec670dbd7 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/README.md +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/README.md @@ -93,7 +93,7 @@ for (BinaryData n: names) { Let's enumerate all update version for a given update provider and update name: ``` java com.azure.iot.deviceupdate.DeviceUpdateClient.EnumerateVersions -PagedIterable versions = client.listVersions(updateProvider, updateName, null); +PagedIterable versions = client.listVersions(updateProvider, updateName, new RequestOptions()); for (BinaryData v: versions) { System.out.println(v); } @@ -161,7 +161,7 @@ for (String fileId: fileIds) { To enumerate all registered devices and print their device identifiers: ``` java com.azure.iot.deviceupdate.DeviceManagementClient.EnumerateDevices -PagedIterable devices = client.listDevices(null); +PagedIterable devices = client.listDevices(new RequestOptions()); for (BinaryData d: devices) { System.out.println(new ObjectMapper().readTree(d.toBytes()).get("deviceId").asText()); } @@ -172,7 +172,7 @@ for (BinaryData d: devices) { To enumerate all available device groups and print their group identifiers: ``` java com.azure.iot.deviceupdate.DeviceManagementClient.EnumerateGroups -PagedIterable groups = client.listGroups(null); +PagedIterable groups = client.listGroups(new RequestOptions()); for (BinaryData g: groups) { System.out.println(new ObjectMapper().readTree(g.toBytes()).get("groupId").asText()); } @@ -183,7 +183,7 @@ for (BinaryData g: groups) { To enumerate all available device classes and print their device class identifiers: ``` java com.azure.iot.deviceupdate.DeviceManagementClient.EnumerateDeviceClasses -PagedIterable deviceClasses = client.listDeviceClasses(null); +PagedIterable deviceClasses = client.listDeviceClasses(new RequestOptions()); for (BinaryData dc: deviceClasses) { System.out.println(new ObjectMapper().readTree(dc.toBytes()).get("deviceClassId").asText()); } @@ -270,7 +270,8 @@ response.waitForCompletion(); Let's retrieve specific update metadata: ``` java com.azure.iot.deviceupdate.DeviceUpdateClient.DeleteUpdate -SyncPoller response = client.beginDeleteUpdate(updateProvider, updateName, updateVersion, null); +SyncPoller response = client.beginDeleteUpdate(updateProvider, updateName, + updateVersion, new RequestOptions()); response.waitForCompletion(); ``` 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..869d34aef72d 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; @@ -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, new RequestOptions()); 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..8988841b5a74 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(new RequestOptions()); 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(new RequestOptions()); 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(new RequestOptions()); for (BinaryData dc: deviceClasses) { System.out.println(new ObjectMapper().readTree(dc.toBytes()).get("deviceClassId").asText()); } 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..48d40be91286 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; @@ -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, new RequestOptions()); 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 deleted file mode 100644 index 92d08cba9ab2..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java +++ /dev/null @@ -1,32 +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 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 - } -} 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 deleted file mode 100644 index 5b4c876bf834..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java +++ /dev/null @@ -1,27 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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 - } -} 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 deleted file mode 100644 index e812e734478b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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 - } -} 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 deleted file mode 100644 index c3e43adccc0e..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java +++ /dev/null @@ -1,26 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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 - } -} 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 deleted file mode 100644 index a261f32ac5e5..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java +++ /dev/null @@ -1,27 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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 - } -} 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 deleted file mode 100644 index e171640401e4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java +++ /dev/null @@ -1,26 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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 - } -} 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 deleted file mode 100644 index 55eb6983a6fd..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.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 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 - } -} 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 deleted file mode 100644 index 22630ab1f1fb..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.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 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 - } -} 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 deleted file mode 100644 index 40daed7a2de4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.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 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 - } -} 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 deleted file mode 100644 index f905063193e5..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java +++ /dev/null @@ -1,27 +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 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 - } -} 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 deleted file mode 100644 index d86114d8742e..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.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 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 - } -} 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 deleted file mode 100644 index 4208038af606..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.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 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 - } -} 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 deleted file mode 100644 index 1d4d3897da3d..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.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 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 - } -} 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 deleted file mode 100644 index 2e0f3f549926..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java +++ /dev/null @@ -1,27 +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 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 - } -} 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 deleted file mode 100644 index 002aba4abbec..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.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 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 - } -} 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 deleted file mode 100644 index bb40d189ba1d..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.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 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 - } -} 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 deleted file mode 100644 index 1a18816230c0..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.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 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 - } -} 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 deleted file mode 100644 index 35f9ed38b62c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java +++ /dev/null @@ -1,27 +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 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 - } -} 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 deleted file mode 100644 index 60f237a29df9..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.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 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 - } -} 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 deleted file mode 100644 index 58ee6f595a0c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.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.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; - -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 - } -} 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 deleted file mode 100644 index 34979b073493..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java +++ /dev/null @@ -1,27 +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.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; - -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 - } -} 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 deleted file mode 100644 index 161aa0c6ece5..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.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.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; - -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 - } -} 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 deleted file mode 100644 index 95d524220eeb..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.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.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; - -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 - } -} 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 deleted file mode 100644 index 7b9dccf787f7..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.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.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; - -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 - } -} 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 deleted file mode 100644 index be2e470c8df3..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java +++ /dev/null @@ -1,27 +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.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; - -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 - } -} 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 deleted file mode 100644 index 130e77ca57d7..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.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.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; - -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 - } -} 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 deleted file mode 100644 index 12c3cf6119ee..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java +++ /dev/null @@ -1,27 +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.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; - -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 - } -} 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 deleted file mode 100644 index 3355f1bb5757..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java +++ /dev/null @@ -1,27 +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.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; - -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 - } -} 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 deleted file mode 100644 index 153806be6fe4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.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.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; - -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 - } -} 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 deleted file mode 100644 index dbfb4bc78ec5..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.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.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; - -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 - } -} 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 deleted file mode 100644 index 1b751e93e6cf..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java +++ /dev/null @@ -1,27 +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.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; - -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 - } -} 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 deleted file mode 100644 index 53b4f6f9866e..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java +++ /dev/null @@ -1,27 +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.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; - -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 - } -} 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 deleted file mode 100644 index dfc074d6c94b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.java +++ /dev/null @@ -1,31 +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 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 - } -} 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 deleted file mode 100644 index 4f7440c3b1a8..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.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 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 - } -} 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 deleted file mode 100644 index bb94d4be21a2..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.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.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; - -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 - } -} 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 deleted file mode 100644 index a4b31f3d9c5a..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.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.DeviceUpdateClient; -import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; - -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 - } -} 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 deleted file mode 100644 index dd7fbea56fb7..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.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.DeviceUpdateClient; -import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; - -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 - } -} 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 deleted file mode 100644 index 7b92e72a0278..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.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.DeviceUpdateClient; -import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; - -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 - } -} 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 deleted file mode 100644 index f2aca6275327..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.java +++ /dev/null @@ -1,31 +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.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; - -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 - } -} 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 deleted file mode 100644 index 87dc0b110f17..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.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.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 - } -} 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 deleted file mode 100644 index 3ad39d2f7f3e..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java +++ /dev/null @@ -1,27 +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.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 - } -} 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 deleted file mode 100644 index 292a2174a726..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java +++ /dev/null @@ -1,27 +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.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 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 - } -} 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 deleted file mode 100644 index 20a5fc225f6e..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java +++ /dev/null @@ -1,27 +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.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 - } -} 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 deleted file mode 100644 index 13c2752544f6..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java +++ /dev/null @@ -1,27 +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.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 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 - } -} 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 deleted file mode 100644 index 3928fdcd3f7f..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java +++ /dev/null @@ -1,27 +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.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 - } -} 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..92f8aa79513f 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(new RequestOptions()); 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(new RequestOptions()); 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(new RequestOptions()); 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, new RequestOptions()); 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", new RequestOptions()); 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/DeviceUpdateClientTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientTests.java index f9f30625f8ff..ecb3ee71dd6b 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; @@ -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, new RequestOptions()); 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", new RequestOptions()); 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/TestData.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/TestData.java index 39e56a0906f4..dc39ea26b697 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/TestData.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/TestData.java @@ -10,26 +10,25 @@ public class TestData { public static final String CLIENT_ID = getTestValue("CLIENT_ID", "clientId"); - public static final String ACCOUNT_ENDPOINT - = getTestValue("ACCOUNT_ENDPOINT", "contosoprodwus2.api.adu.microsoft.com"); + public static final String ACCOUNT_ENDPOINT = getTestValue("ACCOUNT_ENDPOINT", "blue.api.adu.microsoft.com"); public static final String INSTANCE_ID = getTestValue("INSTANCE_ID", "blue"); - public static final String PROVIDER = "sdk-tests-provider"; + public static final String PROVIDER = "Contoso"; - public static final String NAME = "sdk-tests-name"; + public static final String NAME = "ScriptTest"; - public static final String FILE_ID = "f25626693f7c20ff8"; + public static final String FILE_ID = "faea58faa110346f7"; - public static final String VERSION = "2.0.0.0"; + public static final String VERSION = "1.0.0"; - public static final String DEVICE_GROUP = "sdk-tests-group"; + public static final String DEVICE_GROUP = "contoso"; - public static final String DEVICE_CLASS_ID = "c61300e6b3da62926c23d92519ea3f2e73116e71"; + public static final String DEVICE_CLASS_ID = "5272ba869f3fd0b562d6608370462574600d0b4e"; - public static final String DEVICE_ID = "sdk-tests-638309378295188213"; + public static final String DEVICE_ID = "test-device"; - public static final String DEPLOYMENT_ID = "sdk-tests-deployment"; + public static final String DEPLOYMENT_ID = "f0837fc1-b027-4e8f-acc5-76333229c3b7"; private static String getTestValue(String name, String defaultValue) { if (Configuration.getGlobalConfiguration().contains(name)) { diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/README.md b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/README.md deleted file mode 100644 index 2a3ed05ead34..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Azure Device Update for IoT Hub for Java - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Device Update for IoT Hub. - ---- -## Getting Started -To build the SDK for Device Update for IoT Hub, simply [Install AutoRest](https://aka.ms/autorest) and -in this folder, run: - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` - -### Setup -```ps -npm install -g autorest -``` - -### Generation -```ps -cd -autorest -``` - -## Generate autorest code -```yaml -use: '@autorest/java@4.1.62' -input-file: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/deviceupdate/data-plane/Microsoft.DeviceUpdate/stable/2022-10-01/deviceupdate.json -java: true -output-folder: ./ -enable-sync-stack: true -generate-tests: true -title: DeviceUpdateClient -generate-sync-async-clients: true -generate-client-as-impl: true -artifact-id: azure-iot-deviceupdate -data-plane: true -sync-methods: all -generate-samples: true -license-header: MICROSOFT_MIT_SMALL -namespace: com.azure.iot.deviceupdate -service-name: DeviceUpdate -credential-types: tokencredential -credential-scopes: https://api.adu.microsoft.com/.default -service-versions: - - '2022-10-01' -polling: - default: - strategy: >- - new OperationResourcePollingStrategyWithEndpoint<>({httpPipeline}, "https://" + this.client.getEndpoint(), null, null, {context}) -``` diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java deleted file mode 100644 index 8e41002143a9..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementAsyncClient.java +++ /dev/null @@ -1,1763 +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; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -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.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.iot.deviceupdate.implementation.DeviceManagementsImpl; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous DeviceUpdateClient type. - */ -@ServiceClient(builder = DeviceManagementClientBuilder.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 - DeviceManagementAsyncClient(DeviceManagementsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
-     * 
- * - * @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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeviceClasses(RequestOptions requestOptions) { - return this.serviceClient.listDeviceClassesAsync(requestOptions); - } - - /** - * Gets the properties of a device class. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 properties of a device class along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassWithResponseAsync(deviceClassId, requestOptions); - } - - /** - * Update device class details. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     friendlyName: String (Required)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
-     * 
- * - * @param deviceClassId Device class identifier. - * @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. - * @throws ResourceNotFoundException thrown if 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 metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateDeviceClassWithResponse(String deviceClassId, BinaryData deviceClassPatch, - RequestOptions requestOptions) { - return this.serviceClient.updateDeviceClassWithResponseAsync(deviceClassId, deviceClassPatch, requestOptions); - } - - /** - * 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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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> deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - return this.serviceClient.deleteDeviceClassWithResponseAsync(deviceClassId, requestOptions); - } - - /** - * Gets a list of installable updates for a device class. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listInstallableUpdatesForDeviceClass(String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.listInstallableUpdatesForDeviceClassAsync(deviceClassId, requestOptions); - } - - /** - * Gets a list of devices connected to Device Update for IoT Hub. - *

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).
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: 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 PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDevices(RequestOptions requestOptions) { - return this.serviceClient.listDevicesAsync(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
-     * 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginImportDevices(BinaryData importType, RequestOptions requestOptions) { - return this.serviceClient.beginImportDevicesAsync(importType, requestOptions); - } - - /** - * 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)
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
-     * 
- * - * @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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { - return this.serviceClient.getDeviceWithResponseAsync(deviceId, requestOptions); - } - - /** - * 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)
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
-     * 
- * - * @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. - * @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 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) - public Mono> getDeviceModuleWithResponse(String deviceId, String moduleId, - RequestOptions requestOptions) { - return this.serviceClient.getDeviceModuleWithResponseAsync(deviceId, moduleId, requestOptions); - } - - /** - * 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUpdateComplianceWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getUpdateComplianceWithResponseAsync(requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
-     * 
- * - * @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 groups as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listGroups(RequestOptions requestOptions) { - return this.serviceClient.listGroupsAsync(requestOptions); - } - - /** - * Gets the device group properties. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
-     * 
- * - * @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 device group properties along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.serviceClient.getGroupWithResponseAsync(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. - * - * @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 {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.serviceClient.deleteGroupWithResponseAsync(groupId, requestOptions); - } - - /** - * 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUpdateComplianceForGroupWithResponse(String groupId, - RequestOptions requestOptions) { - return this.serviceClient.getUpdateComplianceForGroupWithResponseAsync(groupId, requestOptions); - } - - /** - * 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)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
-     *         }
-     *         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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listBestUpdatesForGroup(String groupId, RequestOptions requestOptions) { - return this.serviceClient.listBestUpdatesForGroupAsync(groupId, requestOptions); - } - - /** - * Gets a list of deployments for a device group. - *

Query Parameters

- * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 a list of deployments for a device group as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { - return this.serviceClient.listDeploymentsForGroupAsync(groupId, requestOptions); - } - - /** - * Gets the deployment properties. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment properties along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeploymentWithResponse(String groupId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.getDeploymentWithResponseAsync(groupId, deploymentId, requestOptions); - } - - /** - * Creates or updates a deployment. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createOrUpdateDeploymentWithResponse(String groupId, String deploymentId, - BinaryData deployment, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateDeploymentWithResponseAsync(groupId, deploymentId, deployment, - 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); - } - - /** - * 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)
-     *     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)
-     *     }
-     *     subgroupStatus (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             deviceClassId: String (Required)
-     *             deploymentState: String(Active/Failed/Inactive/Canceled) (Required)
-     *             error (Optional): (recursive schema, see error above)
-     *             totalDevices: Integer (Optional)
-     *             devicesInProgressCount: Integer (Optional)
-     *             devicesCompletedFailedCount: Integer (Optional)
-     *             devicesCompletedSucceededCount: Integer (Optional)
-     *             devicesCanceledCount: Integer (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @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 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) - public Mono> getDeploymentStatusWithResponse(String groupId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.getDeploymentStatusWithResponseAsync(groupId, deploymentId, requestOptions); - } - - /** - * 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')
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeviceClassSubgroupsForGroup(String groupId, RequestOptions requestOptions) { - return this.serviceClient.listDeviceClassSubgroupsForGroupAsync(groupId, requestOptions); - } - - /** - * 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)
-     *     createdDateTime: String (Required)
-     *     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. - * @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 class subgroup details along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions); - } - - /** - * 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. - * @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> deleteDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.deleteDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions); - } - - /** - * 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. - * @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 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) - public Mono> getDeviceClassSubgroupUpdateComplianceWithResponse(String groupId, - String deviceClassId, RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassSubgroupUpdateComplianceWithResponseAsync(groupId, deviceClassId, - requestOptions); - } - - /** - * 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)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
-     *         }
-     *         description: String (Optional)
-     *         friendlyName: String (Optional)
-     *     }
-     *     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. - * @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 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) - public Mono> getBestUpdatesForDeviceClassSubgroupWithResponse(String groupId, - String deviceClassId, RequestOptions requestOptions) { - return this.serviceClient.getBestUpdatesForDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, - requestOptions); - } - - /** - * Gets a list of deployments for a device class subgroup. - *

Query Parameters

- * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.listDeploymentsForDeviceClassSubgroupAsync(groupId, deviceClassId, requestOptions); - } - - /** - * Gets the deployment properties. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment properties along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeploymentForDeviceClassSubgroupWithResponse(String groupId, - String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.getDeploymentForDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, - 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
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDeploymentWithResponse(String groupId, String deviceClassId, - String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.stopDeploymentWithResponseAsync(groupId, deviceClassId, deploymentId, requestOptions); - } - - /** - * Retries a deployment with failed devices. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> retryDeploymentWithResponse(String groupId, String deviceClassId, - String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.retryDeploymentWithResponseAsync(groupId, deviceClassId, 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
-     * {
-     *     groupId: String (Required)
-     *     deviceClassId: String (Required)
-     *     deploymentState: String(Active/Failed/Inactive/Canceled) (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)
-     *     }
-     *     totalDevices: Integer (Optional)
-     *     devicesInProgressCount: Integer (Optional)
-     *     devicesCompletedFailedCount: Integer (Optional)
-     *     devicesCompletedSucceededCount: Integer (Optional)
-     *     devicesCanceledCount: Integer (Optional)
-     * }
-     * }
-     * 
- * - * @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 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) - public Mono> getDeviceClassSubgroupDeploymentStatusWithResponse(String groupId, - String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassSubgroupDeploymentStatusWithResponseAsync(groupId, deviceClassId, - deploymentId, requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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. - * @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 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, RequestOptions requestOptions) { - return this.serviceClient.listDeviceStatesForDeviceClassSubgroupDeploymentAsync(groupId, deviceClassId, - deploymentId, requestOptions); - } - - /** - * Retrieve operation status. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOperationStatusWithResponse(String operationId, - RequestOptions requestOptions) { - return this.serviceClient.getOperationStatusWithResponseAsync(operationId, requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationStatuses(RequestOptions requestOptions) { - return this.serviceClient.listOperationStatusesAsync(requestOptions); - } - - /** - * Start the device diagnostics log collection on specified devices. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @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 diagnostics request body along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> startLogCollectionWithResponse(String logCollectionId, BinaryData logCollection, - RequestOptions requestOptions) { - return this.serviceClient.startLogCollectionWithResponseAsync(logCollectionId, logCollection, requestOptions); - } - - /** - * Get the device diagnostics log collection. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLogCollectionWithResponse(String logCollectionId, - RequestOptions requestOptions) { - return this.serviceClient.getLogCollectionWithResponseAsync(logCollectionId, requestOptions); - } - - /** - * Get all device diagnostics log collections. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listLogCollections(RequestOptions requestOptions) { - return this.serviceClient.listLogCollectionsAsync(requestOptions); - } - - /** - * Get log collection with detailed status. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     operationId: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
-     *     deviceStatus (Optional): [
-     *          (Optional){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             resultCode: String (Optional)
-     *             extendedResultCode: String (Optional)
-     *             logLocation: String (Optional)
-     *         }
-     *     ]
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 log collection with detailed status along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLogCollectionDetailedStatusWithResponse(String logCollectionId, - RequestOptions requestOptions) { - return this.serviceClient.getLogCollectionDetailedStatusWithResponseAsync(logCollectionId, requestOptions); - } - - /** - * Get list of device health. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if 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 device health as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listHealthOfDevices(String filter, RequestOptions requestOptions) { - return this.serviceClient.listHealthOfDevicesAsync(filter, requestOptions); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java deleted file mode 100644 index 90816a6c7fff..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClient.java +++ /dev/null @@ -1,1757 +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; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -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; - -/** - * Initializes a new instance of the synchronous DeviceUpdateClient type. - */ -@ServiceClient(builder = DeviceManagementClientBuilder.class) -public final class DeviceManagementClient { - @Generated - private final DeviceManagementsImpl serviceClient; - - /** - * Initializes an instance of DeviceManagementClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - DeviceManagementClient(DeviceManagementsImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
-     * 
- * - * @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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceClasses(RequestOptions requestOptions) { - return this.serviceClient.listDeviceClasses(requestOptions); - } - - /** - * Gets the properties of a device class. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 properties of a device class along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassWithResponse(deviceClassId, requestOptions); - } - - /** - * Update device class details. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     friendlyName: String (Required)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     }
-     * }
-     * }
-     * 
- * - * @param deviceClassId Device class identifier. - * @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. - * @throws ResourceNotFoundException thrown if 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 metadata along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateDeviceClassWithResponse(String deviceClassId, BinaryData deviceClassPatch, - RequestOptions requestOptions) { - return this.serviceClient.updateDeviceClassWithResponse(deviceClassId, deviceClassPatch, requestOptions); - } - - /** - * 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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - return this.serviceClient.deleteDeviceClassWithResponse(deviceClassId, requestOptions); - } - - /** - * Gets a list of installable updates for a device class. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listInstallableUpdatesForDeviceClass(String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.listInstallableUpdatesForDeviceClass(deviceClassId, requestOptions); - } - - /** - * Gets a list of devices connected to Device Update for IoT Hub. - *

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).
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDevices(RequestOptions requestOptions) { - return this.serviceClient.listDevices(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
-     * 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginImportDevices(BinaryData importType, RequestOptions requestOptions) { - return this.serviceClient.beginImportDevices(importType, requestOptions); - } - - /** - * 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)
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
-     * 
- * - * @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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { - return this.serviceClient.getDeviceWithResponse(deviceId, requestOptions); - } - - /** - * 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)
-     *     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)
-     *                 resultCode: int (Required)
-     *                 extendedResultCode: int (Required)
-     *                 resultDetails: String (Optional)
-     *             }
-     *         ]
-     *     }
-     * }
-     * }
-     * 
- * - * @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. - * @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 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) - public Response getDeviceModuleWithResponse(String deviceId, String moduleId, - RequestOptions requestOptions) { - return this.serviceClient.getDeviceModuleWithResponse(deviceId, moduleId, requestOptions); - } - - /** - * 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUpdateComplianceWithResponse(RequestOptions requestOptions) { - return this.serviceClient.getUpdateComplianceWithResponse(requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
-     * 
- * - * @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 groups as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGroups(RequestOptions requestOptions) { - return this.serviceClient.listGroups(requestOptions); - } - - /** - * Gets the device group properties. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *     ]
-     * }
-     * }
-     * 
- * - * @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 device group properties along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.serviceClient.getGroupWithResponse(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. - * - * @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 {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.serviceClient.deleteGroupWithResponse(groupId, requestOptions); - } - - /** - * 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUpdateComplianceForGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.serviceClient.getUpdateComplianceForGroupWithResponse(groupId, requestOptions); - } - - /** - * 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)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
-     *         }
-     *         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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBestUpdatesForGroup(String groupId, RequestOptions requestOptions) { - return this.serviceClient.listBestUpdatesForGroup(groupId, requestOptions); - } - - /** - * Gets a list of deployments for a device group. - *

Query Parameters

- * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 a list of deployments for a device group as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { - return this.serviceClient.listDeploymentsForGroup(groupId, requestOptions); - } - - /** - * Gets the deployment properties. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment properties along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeploymentWithResponse(String groupId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.getDeploymentWithResponse(groupId, deploymentId, requestOptions); - } - - /** - * Creates or updates a deployment. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateDeploymentWithResponse(String groupId, String deploymentId, - BinaryData deployment, RequestOptions requestOptions) { - return this.serviceClient.createOrUpdateDeploymentWithResponse(groupId, deploymentId, deployment, - 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); - } - - /** - * 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)
-     *     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)
-     *     }
-     *     subgroupStatus (Required): [
-     *          (Required){
-     *             groupId: String (Required)
-     *             deviceClassId: String (Required)
-     *             deploymentState: String(Active/Failed/Inactive/Canceled) (Required)
-     *             error (Optional): (recursive schema, see error above)
-     *             totalDevices: Integer (Optional)
-     *             devicesInProgressCount: Integer (Optional)
-     *             devicesCompletedFailedCount: Integer (Optional)
-     *             devicesCompletedSucceededCount: Integer (Optional)
-     *             devicesCanceledCount: Integer (Optional)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @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 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) - public Response getDeploymentStatusWithResponse(String groupId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.getDeploymentStatusWithResponse(groupId, deploymentId, requestOptions); - } - - /** - * 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')
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceClassSubgroupsForGroup(String groupId, RequestOptions requestOptions) { - return this.serviceClient.listDeviceClassSubgroupsForGroup(groupId, requestOptions); - } - - /** - * 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)
-     *     createdDateTime: String (Required)
-     *     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. - * @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 class subgroup details along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions); - } - - /** - * 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. - * @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 deleteDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.deleteDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions); - } - - /** - * 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. - * @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 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) - public Response getDeviceClassSubgroupUpdateComplianceWithResponse(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassSubgroupUpdateComplianceWithResponse(groupId, deviceClassId, - requestOptions); - } - - /** - * 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)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
-     *         }
-     *         description: String (Optional)
-     *         friendlyName: String (Optional)
-     *     }
-     *     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. - * @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 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) - public Response getBestUpdatesForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.getBestUpdatesForDeviceClassSubgroupWithResponse(groupId, deviceClassId, - requestOptions); - } - - /** - * Gets a list of deployments for a device class subgroup. - *

Query Parameters

- * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @param groupId Group identifier. - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsForDeviceClassSubgroup(String groupId, String deviceClassId, - RequestOptions requestOptions) { - return this.serviceClient.listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions); - } - - /** - * Gets the deployment properties. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment properties along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeploymentForDeviceClassSubgroupWithResponse(String groupId, String deviceClassId, - String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.getDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, 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); - } - - /** - * Stops a deployment. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment metadata along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.stopDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions); - } - - /** - * Retries a deployment with failed devices. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 deployment metadata along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response retryDeploymentWithResponse(String groupId, String deviceClassId, String deploymentId, - RequestOptions requestOptions) { - return this.serviceClient.retryDeploymentWithResponse(groupId, deviceClassId, 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
-     * {
-     *     groupId: String (Required)
-     *     deviceClassId: String (Required)
-     *     deploymentState: String(Active/Failed/Inactive/Canceled) (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)
-     *     }
-     *     totalDevices: Integer (Optional)
-     *     devicesInProgressCount: Integer (Optional)
-     *     devicesCompletedFailedCount: Integer (Optional)
-     *     devicesCompletedSucceededCount: Integer (Optional)
-     *     devicesCanceledCount: Integer (Optional)
-     * }
-     * }
-     * 
- * - * @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 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) - public Response getDeviceClassSubgroupDeploymentStatusWithResponse(String groupId, String deviceClassId, - String deploymentId, RequestOptions requestOptions) { - return this.serviceClient.getDeviceClassSubgroupDeploymentStatusWithResponse(groupId, deviceClassId, - deploymentId, requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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. - * @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 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, RequestOptions requestOptions) { - return this.serviceClient.listDeviceStatesForDeviceClassSubgroupDeployment(groupId, deviceClassId, deploymentId, - requestOptions); - } - - /** - * Retrieve operation status. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { - return this.serviceClient.getOperationStatusWithResponse(operationId, requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - return this.serviceClient.listOperationStatuses(requestOptions); - } - - /** - * Start the device diagnostics log collection on specified devices. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @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 diagnostics request body along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startLogCollectionWithResponse(String logCollectionId, BinaryData logCollection, - RequestOptions requestOptions) { - return this.serviceClient.startLogCollectionWithResponse(logCollectionId, logCollection, requestOptions); - } - - /** - * Get the device diagnostics log collection. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLogCollectionWithResponse(String logCollectionId, RequestOptions requestOptions) { - return this.serviceClient.getLogCollectionWithResponse(logCollectionId, requestOptions); - } - - /** - * Get all device diagnostics log collections. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLogCollections(RequestOptions requestOptions) { - return this.serviceClient.listLogCollections(requestOptions); - } - - /** - * Get log collection with detailed status. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     operationId: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
-     *     deviceStatus (Optional): [
-     *          (Optional){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             resultCode: String (Optional)
-     *             extendedResultCode: String (Optional)
-     *             logLocation: String (Optional)
-     *         }
-     *     ]
-     *     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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 log collection with detailed status along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLogCollectionDetailedStatusWithResponse(String logCollectionId, - RequestOptions requestOptions) { - return this.serviceClient.getLogCollectionDetailedStatusWithResponse(logCollectionId, requestOptions); - } - - /** - * Get list of device health. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     *         }
-     *     ]
-     * }
-     * }
-     * 
- * - * @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. - * @throws ResourceNotFoundException thrown if 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 device health as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHealthOfDevices(String filter, RequestOptions requestOptions) { - return this.serviceClient.listHealthOfDevices(filter, requestOptions); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClientBuilder.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClientBuilder.java deleted file mode 100644 index 40224e14ab9b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceManagementClientBuilder.java +++ /dev/null @@ -1,352 +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; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -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; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A builder for creating a new instance of the DeviceManagementClient type. - */ -@ServiceClientBuilder(serviceClients = { DeviceManagementClient.class, DeviceManagementAsyncClient.class }) -public final class DeviceManagementClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://api.adu.microsoft.com/.default" }; - - @Generated - private static final Map PROPERTIES = CoreUtils.getProperties("azure-iot-deviceupdate.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the DeviceManagementClientBuilder. - */ - @Generated - public DeviceManagementClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder 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; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The Device Update for IoT Hub account instance identifier. - */ - @Generated - private String instanceId; - - /** - * Sets The Device Update for IoT Hub account instance identifier. - * - * @param instanceId the instanceId value. - * @return the DeviceManagementClientBuilder. - */ - @Generated - public DeviceManagementClientBuilder instanceId(String instanceId) { - this.instanceId = instanceId; - return this; - } - - /* - * Service version - */ - @Generated - private DeviceUpdateServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the DeviceManagementClientBuilder. - */ - @Generated - public DeviceManagementClientBuilder serviceVersion(DeviceUpdateServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the DeviceManagementClientBuilder. - */ - @Generated - public DeviceManagementClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * 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(), 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 - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); - if (headers != null) { - policies.add(new AddHeadersPolicy(headers)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(localHttpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of DeviceManagementAsyncClient class. - * - * @return an instance of DeviceManagementAsyncClient. - */ - @Generated - public DeviceManagementAsyncClient buildAsyncClient() { - return new DeviceManagementAsyncClient(buildInnerClient().getDeviceManagements()); - } - - /** - * Builds an instance of DeviceManagementClient class. - * - * @return an instance of DeviceManagementClient. - */ - @Generated - public DeviceManagementClient buildClient() { - return new DeviceManagementClient(buildInnerClient().getDeviceManagements()); - } - - private static final ClientLogger LOGGER = new ClientLogger(DeviceManagementClientBuilder.class); -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java deleted file mode 100644 index 9fec7aa679b4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateAsyncClient.java +++ /dev/null @@ -1,606 +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; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -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.util.BinaryData; -import com.azure.core.util.polling.PollerFlux; -import com.azure.iot.deviceupdate.implementation.DeviceUpdatesImpl; -import reactor.core.publisher.Mono; - -/** - * Initializes a new instance of the asynchronous DeviceUpdateClient type. - */ -@ServiceClient(builder = DeviceUpdateClientBuilder.class, isAsync = true) -public final class DeviceUpdateAsyncClient { - @Generated - private final DeviceUpdatesImpl serviceClient; - - /** - * Initializes an instance of DeviceUpdateAsyncClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - DeviceUpdateAsyncClient(DeviceUpdatesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Get a list of all updates that have been imported to Device Update for IoT Hub. - *

Query Parameters

- * - * - * - * - * - *
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUpdates(RequestOptions requestOptions) { - return this.serviceClient.listUpdatesAsync(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
-     * [
-     *      (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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 PollerFlux} for polling of update metadata. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginImportUpdate(BinaryData updateToImport, - RequestOptions requestOptions) { - return this.serviceClient.beginImportUpdateAsync(updateToImport, requestOptions); - } - - /** - * Get a specific update version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @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 a specific update version along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUpdateWithResponse(String provider, String name, String version, - RequestOptions requestOptions) { - return this.serviceClient.getUpdateWithResponseAsync(provider, name, version, requestOptions); - } - - /** - * 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - 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
-     * 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProviders(RequestOptions requestOptions) { - return this.serviceClient.listProvidersAsync(requestOptions); - } - - /** - * Get a list of all update names that match the specified provider. - *

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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNames(String provider, RequestOptions requestOptions) { - return this.serviceClient.listNamesAsync(provider, requestOptions); - } - - /** - * Get a list of all update versions that match the specified provider and name. - *

Query Parameters

- * - * - * - * - *
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
-     * String
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @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 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, RequestOptions requestOptions) { - return this.serviceClient.listVersionsAsync(provider, name, requestOptions); - } - - /** - * Get a list of all update file identifiers for the specified version. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - return this.serviceClient.listFilesAsync(provider, name, version, requestOptions); - } - - /** - * Get a specific update file from the version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     fileName: String (Required)
-     *     sizeInBytes: long (Required)
-     *     hashes (Required): {
-     *         String: String (Required)
-     *     }
-     *     mimeType: String (Optional)
-     *     scanResult: String (Optional)
-     *     scanDetails: String (Optional)
-     *     properties (Optional): {
-     *         String: String (Required)
-     *     }
-     *     fileId: String (Required)
-     *     relatedFiles (Optional): [
-     *          (Optional){
-     *             fileName: String (Required)
-     *             sizeInBytes: long (Required)
-     *             hashes (Required): {
-     *                 String: String (Required)
-     *             }
-     *             mimeType: String (Optional)
-     *             scanResult: String (Optional)
-     *             scanDetails: String (Optional)
-     *             properties (Optional): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     downloadHandler (Optional): {
-     *         id: String (Required)
-     *     }
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @param version Update version. - * @param fileId File 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 a specific update file from the version along with {@link Response} on successful completion of - * {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getFileWithResponse(String provider, String name, String version, String fileId, - RequestOptions requestOptions) { - return this.serviceClient.getFileWithResponseAsync(provider, name, version, fileId, requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationStatuses(RequestOptions requestOptions) { - return this.serviceClient.listOperationStatusesAsync(requestOptions); - } - - /** - * Retrieve operation status. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOperationStatusWithResponse(String operationId, - RequestOptions requestOptions) { - return this.serviceClient.getOperationStatusWithResponseAsync(operationId, requestOptions); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java deleted file mode 100644 index 5823d7012195..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClient.java +++ /dev/null @@ -1,603 +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; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceClient; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -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; - -/** - * Initializes a new instance of the synchronous DeviceUpdateClient type. - */ -@ServiceClient(builder = DeviceUpdateClientBuilder.class) -public final class DeviceUpdateClient { - @Generated - private final DeviceUpdatesImpl serviceClient; - - /** - * Initializes an instance of DeviceUpdateClient class. - * - * @param serviceClient the service client implementation. - */ - @Generated - DeviceUpdateClient(DeviceUpdatesImpl serviceClient) { - this.serviceClient = serviceClient; - } - - /** - * Get a list of all updates that have been imported to Device Update for IoT Hub. - *

Query Parameters

- * - * - * - * - * - *
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUpdates(RequestOptions requestOptions) { - return this.serviceClient.listUpdates(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
-     * [
-     *      (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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginImportUpdate(BinaryData updateToImport, - RequestOptions requestOptions) { - return this.serviceClient.beginImportUpdate(updateToImport, requestOptions); - } - - /** - * Get a specific update version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @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 a specific update version along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUpdateWithResponse(String provider, String name, String version, - RequestOptions requestOptions) { - return this.serviceClient.getUpdateWithResponse(provider, name, version, requestOptions); - } - - /** - * 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. - */ - @Generated - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - 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
-     * 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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProviders(RequestOptions requestOptions) { - return this.serviceClient.listProviders(requestOptions); - } - - /** - * Get a list of all update names that match the specified provider. - *

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}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNames(String provider, RequestOptions requestOptions) { - return this.serviceClient.listNames(provider, requestOptions); - } - - /** - * Get a list of all update versions that match the specified provider and name. - *

Query Parameters

- * - * - * - * - *
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
-     * String
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @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 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, RequestOptions requestOptions) { - return this.serviceClient.listVersions(provider, name, requestOptions); - } - - /** - * Get a list of all update file identifiers for the specified version. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - return this.serviceClient.listFiles(provider, name, version, requestOptions); - } - - /** - * Get a specific update file from the version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     fileName: String (Required)
-     *     sizeInBytes: long (Required)
-     *     hashes (Required): {
-     *         String: String (Required)
-     *     }
-     *     mimeType: String (Optional)
-     *     scanResult: String (Optional)
-     *     scanDetails: String (Optional)
-     *     properties (Optional): {
-     *         String: String (Required)
-     *     }
-     *     fileId: String (Required)
-     *     relatedFiles (Optional): [
-     *          (Optional){
-     *             fileName: String (Required)
-     *             sizeInBytes: long (Required)
-     *             hashes (Required): {
-     *                 String: String (Required)
-     *             }
-     *             mimeType: String (Optional)
-     *             scanResult: String (Optional)
-     *             scanDetails: String (Optional)
-     *             properties (Optional): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     downloadHandler (Optional): {
-     *         id: String (Required)
-     *     }
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @param version Update version. - * @param fileId File 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 a specific update file from the version along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getFileWithResponse(String provider, String name, String version, String fileId, - RequestOptions requestOptions) { - return this.serviceClient.getFileWithResponse(provider, name, version, fileId, requestOptions); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - return this.serviceClient.listOperationStatuses(requestOptions); - } - - /** - * Retrieve operation status. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { - return this.serviceClient.getOperationStatusWithResponse(operationId, requestOptions); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java deleted file mode 100644 index c6f494e76afa..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateClientBuilder.java +++ /dev/null @@ -1,352 +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; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.client.traits.ConfigurationTrait; -import com.azure.core.client.traits.EndpointTrait; -import com.azure.core.client.traits.HttpTrait; -import com.azure.core.client.traits.TokenCredentialTrait; -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -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.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.util.ClientOptions; -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; -import java.util.List; -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 }) -public final class DeviceUpdateClientBuilder - implements HttpTrait, ConfigurationTrait, - TokenCredentialTrait, EndpointTrait { - @Generated - private static final String SDK_NAME = "name"; - - @Generated - private static final String SDK_VERSION = "version"; - - @Generated - private static final String[] DEFAULT_SCOPES = new String[] { "https://api.adu.microsoft.com/.default" }; - - @Generated - private static final Map PROPERTIES = CoreUtils.getProperties("azure-iot-deviceupdate.properties"); - - @Generated - private final List pipelinePolicies; - - /** - * Create an instance of the DeviceUpdateClientBuilder. - */ - @Generated - public DeviceUpdateClientBuilder() { - this.pipelinePolicies = new ArrayList<>(); - } - - /* - * The HTTP client used to send the request. - */ - @Generated - private HttpClient httpClient; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; - return this; - } - - /* - * The HTTP pipeline to send requests through. - */ - @Generated - private HttpPipeline pipeline; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - 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; - } - - /* - * The logging configuration for HTTP requests and responses. - */ - @Generated - private HttpLogOptions httpLogOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; - return this; - } - - /* - * The client options such as application ID and custom headers to set on a request. - */ - @Generated - private ClientOptions clientOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder clientOptions(ClientOptions clientOptions) { - this.clientOptions = clientOptions; - return this; - } - - /* - * The retry options to configure retry policy for failed requests. - */ - @Generated - private RetryOptions retryOptions; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder retryOptions(RetryOptions retryOptions) { - this.retryOptions = retryOptions; - return this; - } - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); - pipelinePolicies.add(customPolicy); - return this; - } - - /* - * The configuration store that is used during construction of the service client. - */ - @Generated - private Configuration configuration; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder configuration(Configuration configuration) { - this.configuration = configuration; - return this; - } - - /* - * The TokenCredential used for authentication. - */ - @Generated - private TokenCredential tokenCredential; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder credential(TokenCredential tokenCredential) { - this.tokenCredential = tokenCredential; - return this; - } - - /* - * The service endpoint - */ - @Generated - private String endpoint; - - /** - * {@inheritDoc}. - */ - @Generated - @Override - public DeviceUpdateClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The Device Update for IoT Hub account instance identifier. - */ - @Generated - private String instanceId; - - /** - * Sets The Device Update for IoT Hub account instance identifier. - * - * @param instanceId the instanceId value. - * @return the DeviceUpdateClientBuilder. - */ - @Generated - public DeviceUpdateClientBuilder instanceId(String instanceId) { - this.instanceId = instanceId; - return this; - } - - /* - * Service version - */ - @Generated - private DeviceUpdateServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the DeviceUpdateClientBuilder. - */ - @Generated - public DeviceUpdateClientBuilder serviceVersion(DeviceUpdateServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - - /* - * The retry policy that will attempt to retry failed requests, if applicable. - */ - @Generated - private RetryPolicy retryPolicy; - - /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. - * @return the DeviceUpdateClientBuilder. - */ - @Generated - public DeviceUpdateClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; - return this; - } - - /** - * 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(), 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 - = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; - ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; - List policies = new ArrayList<>(); - String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); - String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); - policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); - policies.add(new RequestIdPolicy()); - policies.add(new AddHeadersFromContextPolicy()); - HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); - if (headers != null) { - policies.add(new AddHeadersPolicy(headers)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); - policies.add(new AddDatePolicy()); - if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); - } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(localHttpLogOptions)); - HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); - return httpPipeline; - } - - /** - * Builds an instance of DeviceUpdateAsyncClient class. - * - * @return an instance of DeviceUpdateAsyncClient. - */ - @Generated - public DeviceUpdateAsyncClient buildAsyncClient() { - return new DeviceUpdateAsyncClient(buildInnerClient().getDeviceUpdates()); - } - - /** - * Builds an instance of DeviceUpdateClient class. - * - * @return an instance of DeviceUpdateClient. - */ - @Generated - public DeviceUpdateClient buildClient() { - return new DeviceUpdateClient(buildInnerClient().getDeviceUpdates()); - } - - private static final ClientLogger LOGGER = new ClientLogger(DeviceUpdateClientBuilder.class); -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java deleted file mode 100644 index c37b79ed8538..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/DeviceUpdateServiceVersion.java +++ /dev/null @@ -1,40 +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; - -import com.azure.core.util.ServiceVersion; - -/** - * Service version of DeviceUpdate. - */ -public enum DeviceUpdateServiceVersion implements ServiceVersion { - /** - * Enum value 2022-10-01. - */ - V2022_10_01("2022-10-01"); - - private final String version; - - DeviceUpdateServiceVersion(String version) { - this.version = version; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVersion() { - return this.version; - } - - /** - * Gets the latest service version supported by this client library. - * - * @return The latest {@link DeviceUpdateServiceVersion}. - */ - public static DeviceUpdateServiceVersion getLatest() { - return V2022_10_01; - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java deleted file mode 100644 index 0571bd27bca5..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdateClientImpl.java +++ /dev/null @@ -1,161 +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.implementation; - -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -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. - */ -public final class DeviceUpdateClientImpl { - /** - * 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. - */ - 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. - */ - private final DeviceUpdateServiceVersion serviceVersion; - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public DeviceUpdateServiceVersion getServiceVersion() { - return this.serviceVersion; - } - - /** - * 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. - */ - 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. - */ - 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. - */ - private final DeviceManagementsImpl deviceManagements; - - /** - * Gets the DeviceManagementsImpl object to access its operations. - * - * @return the DeviceManagementsImpl object. - */ - public DeviceManagementsImpl getDeviceManagements() { - return this.deviceManagements; - } - - /** - * 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()).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. - * @param serviceVersion Service version. - */ - public DeviceUpdateClientImpl(HttpPipeline httpPipeline, String endpoint, String instanceId, - DeviceUpdateServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, instanceId, serviceVersion); - } - - /** - * 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). - * @param instanceId The Device Update for IoT Hub account instance identifier. - * @param serviceVersion Service version. - */ - public DeviceUpdateClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - String instanceId, DeviceUpdateServiceVersion serviceVersion) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.endpoint = endpoint; - this.instanceId = instanceId; - this.serviceVersion = serviceVersion; - this.deviceUpdates = new DeviceUpdatesImpl(this); - this.deviceManagements = new DeviceManagementsImpl(this); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java deleted file mode 100644 index e7eb73ffe85d..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java +++ /dev/null @@ -1,2929 +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.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -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.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -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 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. - */ -public final class DeviceUpdatesImpl { - /** - * The proxy service used to perform REST calls. - */ - private final DeviceUpdatesService service; - - /** - * 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) { - this.service - = RestProxy.create(DeviceUpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - 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 = "DeviceUpdateClientDeviceUpdates") - public interface DeviceUpdatesService { - @Get("/deviceUpdate/{instanceId}/updates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Post("/deviceUpdate/{instanceId}/updates:import") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Post("/deviceUpdate/{instanceId}/updates:import") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Delete("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("/deviceUpdate/{instanceId}/updates/operations/{operationId}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @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); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listUpdatesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listUpdatesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listProvidersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listProvidersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNamesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listNamesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listVersionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listVersionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listFilesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listFilesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listOperationStatusesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listOperationStatusesNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - } - - /** - * Get a list of all updates that have been imported to Device Update for IoT Hub. - *

Query Parameters

- * - * - * - * - * - *
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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 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)) - .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
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listUpdatesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listUpdatesSinglePageAsync(requestOptions), - nextLink -> listUpdatesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all updates that have been imported to Device Update for IoT Hub. - *

Query Parameters

- * - * - * - * - * - *
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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 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); - 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
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
-     * {
-     *     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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUpdates(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listUpdatesSinglePage(requestOptions), - nextLink -> listUpdatesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * 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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 update metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> importUpdateWithResponseAsync(BinaryData updateToImport, - RequestOptions requestOptions) { - 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)); - } - - /** - * 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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 update metadata along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Response importUpdateWithResponse(BinaryData updateToImport, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.importUpdateSync(this.client.getEndpoint(), this.client.getInstanceId(), - this.client.getServiceVersion().getVersion(), updateToImport, accept, 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
-     * [
-     *      (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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 PollerFlux} for polling of update metadata. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginImportUpdateAsync(BinaryData updateToImport, - 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 - ? requestOptions.getContext() - : Context.NONE), - 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
-     * [
-     *      (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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     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 beginImportUpdate(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(BinaryData.class), TypeReference.createInstance(BinaryData.class)); - } - - /** - * Get a specific update version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @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 a specific update version along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Get a specific update version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @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 a specific update version along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * 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 Response} on successful completion of {@link Mono}. - */ - @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)); - } - - /** - * 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 Response}. - */ - @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); - } - - /** - * 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 - ? requestOptions.getContext() - : Context.NONE), - 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. - * - * @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 beginDeleteUpdate(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(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
-     * 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}. - */ - @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)) - .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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listProvidersAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listProvidersSinglePageAsync(requestOptions), - nextLink -> listProvidersNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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}. - */ - @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); - 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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listProviders(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listProvidersSinglePage(requestOptions), - nextLink -> listProvidersNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update names that match the specified provider. - *

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 along with {@link PagedResponse} on - * 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)) - .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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listNamesAsync(String provider, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listNamesSinglePageAsync(provider, requestOptions), - nextLink -> listNamesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update names that match the specified provider. - *

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 along with {@link PagedResponse}. - */ - @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); - 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
-     * 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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listNames(String provider, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listNamesSinglePage(provider, requestOptions), - nextLink -> listNamesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update versions that match the specified provider and name. - *

Query Parameters

- * - * - * - * - *
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
-     * String
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @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 versions that match the specified provider and name along with {@link PagedResponse} - * 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)) - .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
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

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. - * @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 versions that match the specified provider and name as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listVersionsAsync(String provider, String name, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listVersionsSinglePageAsync(provider, name, requestOptions), - nextLink -> listVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update versions that match the specified provider and name. - *

Query Parameters

- * - * - * - * - *
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
-     * String
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @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 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); - 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
NameTypeRequiredDescription
filterStringNoOptional to filter updates by isDeployable property.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

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. - * @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 versions that match the specified provider and name as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listVersionsSinglePage(provider, name, requestOptions), - nextLink -> listVersionsNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update file identifiers for the specified version. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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> 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)) - .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
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listFilesSinglePageAsync(provider, name, version, requestOptions), - nextLink -> listFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a list of all update file identifiers for the specified version. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 a list of all update file identifiers for the specified version along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listFilesSinglePage(String provider, String name, String version, - 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); - 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
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listFilesSinglePage(provider, name, version, requestOptions), - nextLink -> listFilesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Get a specific update file from the version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     fileName: String (Required)
-     *     sizeInBytes: long (Required)
-     *     hashes (Required): {
-     *         String: String (Required)
-     *     }
-     *     mimeType: String (Optional)
-     *     scanResult: String (Optional)
-     *     scanDetails: String (Optional)
-     *     properties (Optional): {
-     *         String: String (Required)
-     *     }
-     *     fileId: String (Required)
-     *     relatedFiles (Optional): [
-     *          (Optional){
-     *             fileName: String (Required)
-     *             sizeInBytes: long (Required)
-     *             hashes (Required): {
-     *                 String: String (Required)
-     *             }
-     *             mimeType: String (Optional)
-     *             scanResult: String (Optional)
-     *             scanDetails: String (Optional)
-     *             properties (Optional): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     downloadHandler (Optional): {
-     *         id: String (Required)
-     *     }
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @param version Update version. - * @param fileId File 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 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)); - } - - /** - * Get a specific update file from the version. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     fileName: String (Required)
-     *     sizeInBytes: long (Required)
-     *     hashes (Required): {
-     *         String: String (Required)
-     *     }
-     *     mimeType: String (Optional)
-     *     scanResult: String (Optional)
-     *     scanDetails: String (Optional)
-     *     properties (Optional): {
-     *         String: String (Required)
-     *     }
-     *     fileId: String (Required)
-     *     relatedFiles (Optional): [
-     *          (Optional){
-     *             fileName: String (Required)
-     *             sizeInBytes: long (Required)
-     *             hashes (Required): {
-     *                 String: String (Required)
-     *             }
-     *             mimeType: String (Optional)
-     *             scanResult: String (Optional)
-     *             scanDetails: String (Optional)
-     *             properties (Optional): {
-     *                 String: String (Required)
-     *             }
-     *         }
-     *     ]
-     *     downloadHandler (Optional): {
-     *         id: String (Required)
-     *     }
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @param provider Update provider. - * @param name Update name. - * @param version Update version. - * @param fileId File 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 a specific update file from the version along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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}. - */ - @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)) - .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

- * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationStatusesAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listOperationStatusesSinglePageAsync(requestOptions), - nextLink -> listOperationStatusesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); - } - - /** - * 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.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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); - 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

- * - * - * - * - * - *
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
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listOperationStatusesSinglePage(requestOptions), - nextLink -> listOperationStatusesNextSinglePage(nextLink, requestOptionsForNextPage)); - } - - /** - * Retrieve operation status. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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)); - } - - /** - * Retrieve operation status. - *

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.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if 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 operation metadata along with {@link Response}. - */ - @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); - } - - /** - * Get the next page of items. - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listUpdatesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

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){
-     *             String: String (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)
-     *             }
-     *         ]
-     *     }
-     *     referencedBy (Optional): [
-     *         (recursive schema, see above)
-     *     ]
-     *     scanResult: String (Optional)
-     *     manifestVersion: String (Required)
-     *     importedDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
-     * }
-     * }
-     * 
- * - * @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 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) { - final String accept = "application/json"; - Response res - = service.listUpdatesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listProvidersNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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) { - final String accept = "application/json"; - Response res - = service.listProvidersNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listNamesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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) { - final String accept = "application/json"; - Response res - = service.listNamesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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) { - final String accept = "application/json"; - Response res - = service.listVersionsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listFilesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * String
-     * }
-     * 
- * - * @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 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) { - final String accept = "application/json"; - Response res - = service.listFilesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 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, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listOperationStatusesNext(nextLink, this.client.getEndpoint(), accept, - requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     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)
-     * }
-     * }
-     * 
- * - * @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 a list of all import update operations along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listOperationStatusesNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listOperationStatusesNextSync(nextLink, this.client.getEndpoint(), accept, - requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java deleted file mode 100644 index 92eb6d7c7c88..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/com/azure/iot/deviceupdate/implementation/package-info.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest 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 com.azure.iot.deviceupdate.implementation; diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/module-info.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/module-info.java deleted file mode 100644 index 5cf10a2aa67d..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/java/module-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.iot.deviceupdate { - requires transitive com.azure.core; - - exports com.azure.iot.deviceupdate; -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/resources/azure-iot-deviceupdate.properties b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/resources/azure-iot-deviceupdate.properties deleted file mode 100644 index ca812989b4f2..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/main/resources/azure-iot-deviceupdate.properties +++ /dev/null @@ -1,2 +0,0 @@ -name=${project.artifactId} -version=${project.version} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java deleted file mode 100644 index aa187726059a..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java +++ /dev/null @@ -1,27 +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.device-management-stop-deployment.device-management-cancel-or-retry-deployment - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.stopDeploymentWithResponse("TestGroup", "deviceClassId", - "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-stop-deployment.device-management-cancel-or-retry-deployment - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java deleted file mode 100644 index dcc19d241812..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.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 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.device-management-create-or-update-deployment.device-management-create-or-update-deployment - 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.device-management-create-or-update-deployment.device-management-create-or-update-deployment - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java deleted file mode 100644 index 21aceadaacb0..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeployment.java +++ /dev/null @@ -1,26 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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.device-management-delete-deployment.device-management-delete-deployment - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.deleteDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-delete-deployment.device-management-delete-deployment - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.java deleted file mode 100644 index d23d9b4e39ea..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroup.java +++ /dev/null @@ -1,26 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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.device-management-delete-deployment-for-device-class-subgroup.device-management-delete-deployment-for-device-class-subgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteDeploymentForDeviceClassSubgroupWithResponse("TestGroup", - "deviceClassId", "deploymentId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java deleted file mode 100644 index 80e46f1a67e6..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java +++ /dev/null @@ -1,25 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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.device-management-delete-device-class.device-management-delete-device-class - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteDeviceClassWithResponse("deviceClass1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-delete-device-class.device-management-delete-device-class - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java deleted file mode 100644 index 2d68841b0d8f..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java +++ /dev/null @@ -1,26 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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.device-management-delete-device-class-subgroup.device-management-delete-device-class-subgroup - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.deleteDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java deleted file mode 100644 index fc5eab6ba034..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroup.java +++ /dev/null @@ -1,25 +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.identity.DefaultAzureCredentialBuilder; -import com.azure.iot.deviceupdate.DeviceManagementClient; -import com.azure.iot.deviceupdate.DeviceManagementClientBuilder; - -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.device-management-delete-group.device-management-delete-group - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteGroupWithResponse("group1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-delete-group.device-management-delete-group - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.java deleted file mode 100644 index 5918b36f43bd..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeployment.java +++ /dev/null @@ -1,27 +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 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.device-management-get-deployment.device-management-get-deployment - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-deployment.device-management-get-deployment - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java deleted file mode 100644 index 1d181d9c821f..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java +++ /dev/null @@ -1,27 +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 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.device-management-get-deployment-for-device-class-subgroup.device-management-get-deployment-for-device-class-subgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java deleted file mode 100644 index 782e6d451cf6..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java +++ /dev/null @@ -1,27 +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 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.device-management-get-deployment-status.device-management-get-deployment-status - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeploymentStatusWithResponse("TestGroup", "deploymentId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-deployment-status.device-management-get-deployment-status - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java deleted file mode 100644 index a737dfe2c23e..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDevice.java +++ /dev/null @@ -1,26 +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 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.device-management-get-device.device-management-get-device - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getDeviceWithResponse("deviceId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-device.device-management-get-device - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.java deleted file mode 100644 index 1926186f53ba..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClass.java +++ /dev/null @@ -1,27 +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 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.device-management-get-device-class.device-management-get-device-class - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeviceClassWithResponse("deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-device-class.device-management-get-device-class - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java deleted file mode 100644 index 0b98e4fc2b2a..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java +++ /dev/null @@ -1,27 +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 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.device-management-get-device-class-subgroup-deployment-status.device-management-get-device-class-subgroup-deployment-status - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java deleted file mode 100644 index e1f2fa22d7a1..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java +++ /dev/null @@ -1,27 +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 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.device-management-get-device-class-subgroup-update-compliance.device-management-get-device-class-subgroup-update-compliance - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient - .getDeviceClassSubgroupUpdateComplianceWithResponse("group1", "deviceClassId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java deleted file mode 100644 index bcebaef87757..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroup.java +++ /dev/null @@ -1,26 +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 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.device-management-get-group.device-management-get-group - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getGroupWithResponse("group1", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-group.device-management-get-group - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java deleted file mode 100644 index 648cb500e44c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java +++ /dev/null @@ -1,27 +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.device-management-get-device-class-subgroup.device-management-get-group-update-compliance - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-device-class-subgroup.device-management-get-group-update-compliance - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.java deleted file mode 100644 index 56f71a116718..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollection.java +++ /dev/null @@ -1,27 +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 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.device-management-get-log-collection.device-management-get-log-collection - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getLogCollectionWithResponse("LogCollectionId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-log-collection.device-management-get-log-collection - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.java deleted file mode 100644 index c85b667325cd..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatus.java +++ /dev/null @@ -1,27 +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 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.device-management-get-log-collection-detailed-status.device-management-get-log-collection-detailed-status - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getLogCollectionDetailedStatusWithResponse("LogCollectionId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.java deleted file mode 100644 index 0af07ed03d0b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatus.java +++ /dev/null @@ -1,27 +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 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.device-management-get-operation-status.device-management-get-operation-status - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient - .getOperationStatusWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-operation-status.device-management-get-operation-status - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java deleted file mode 100644 index b26803686c37..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java +++ /dev/null @@ -1,26 +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 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.device-management-get-update-compliance.device-management-get-update-compliance - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getUpdateComplianceWithResponse(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-update-compliance.device-management-get-update-compliance - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.java deleted file mode 100644 index 78679d1e2f8f..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroup.java +++ /dev/null @@ -1,27 +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 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.device-management-get-update-compliance-for-group.device-management-get-update-compliance-for-group - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getUpdateComplianceForGroupWithResponse("group1", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.java deleted file mode 100644 index 4e086707f055..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevices.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.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; - -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.device-management-import-devices.device-management-import-devices - BinaryData importType = BinaryData.fromString("\"All\""); - RequestOptions requestOptions = new RequestOptions(); - SyncPoller response - = deviceManagementClient.beginImportDevices(importType, requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-import-devices.device-management-import-devices - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java deleted file mode 100644 index 6b8662427952..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java +++ /dev/null @@ -1,27 +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.device-management-get-best-updates-for-device-class-subgroup.device-management-list-best-updates-for-device-class-subgroup - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient - .getBestUpdatesForDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-get-best-updates-for-device-class-subgroup.device-management-list-best-updates-for-device-class-subgroup - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java deleted file mode 100644 index b6a1a35b3d65..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java +++ /dev/null @@ -1,26 +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.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; - -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.device-management-list-best-updates-for-group.device-management-list-best-updates-for-group - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listBestUpdatesForGroup("group1", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java deleted file mode 100644 index 3dce8e8ae013..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java +++ /dev/null @@ -1,27 +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.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; - -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.device-management-list-deployments-for-device-class-subgroup.device-management-list-deployments-for-device-class-subgroup - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDeploymentsForDeviceClassSubgroup("TestGroup", - "deviceClassId1", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java deleted file mode 100644 index 2589c73003b0..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java +++ /dev/null @@ -1,27 +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.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; - -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.device-management-list-deployments-for-group.device-management-list-deployments-for-group - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listDeploymentsForGroup("TestGroup", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java deleted file mode 100644 index cdc153cb7db4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java +++ /dev/null @@ -1,27 +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.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; - -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.device-management-list-device-class-subgroups-for-group.device-management-list-device-class-subgroups-for-group - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listDeviceClassSubgroupsForGroup("group1", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java deleted file mode 100644 index 18f92fd08051..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClasses.java +++ /dev/null @@ -1,26 +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.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; - -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.device-management-list-device-classes.device-management-list-device-classes - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDeviceClasses(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-list-device-classes.device-management-list-device-classes - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.java deleted file mode 100644 index bd4be4382d05..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeployment.java +++ /dev/null @@ -1,27 +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.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; - -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.device-management-list-device-states-for-device-class-subgroup-deployment.device-management-list-device-states-for-device-class-subgroup-deployment - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java deleted file mode 100644 index 8319d4665770..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevices.java +++ /dev/null @@ -1,26 +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.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; - -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.device-management-list-devices.device-management-list-devices - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDevices(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-list-devices.device-management-list-devices - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java deleted file mode 100644 index ea5d6ece3d09..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroups.java +++ /dev/null @@ -1,26 +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.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; - -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.device-management-list-groups.device-management-list-groups - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listGroups(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-list-groups.device-management-list-groups - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.java deleted file mode 100644 index 28ef3460c1c6..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevices.java +++ /dev/null @@ -1,27 +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.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; - -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.device-management-list-health-of-devices.device-management-list-health-of-devices - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listHealthOfDevices("state eq 'unhealthy'", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java deleted file mode 100644 index 7697bf55639c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java +++ /dev/null @@ -1,27 +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.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; - -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.device-management-list-installable-updates-for-device-class.device-management-list-installable-updates-for-device-class - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listInstallableUpdatesForDeviceClass("deviceClassId", requestOptions); - // 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/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java deleted file mode 100644 index b0a9bb5bcf1c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollections.java +++ /dev/null @@ -1,26 +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.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; - -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.device-management-list-log-collections.device-management-list-log-collections - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listLogCollections(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-list-log-collections.device-management-list-log-collections - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java deleted file mode 100644 index 2a8c27305d75..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatuses.java +++ /dev/null @@ -1,26 +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.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; - -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.device-management-list-operation-statuses.device-management-list-operation-statuses - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listOperationStatuses(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-list-operation-statuses.device-management-list-operation-statuses - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.java deleted file mode 100644 index 919979a8d30d..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollection.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 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.device-management-start-log-collection.device-management-start-log-collection - 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.device-management-start-log-collection.device-management-start-log-collection - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java deleted file mode 100644 index 339d996e8046..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClass.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 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.device-management-update-device-class.device-management-update-device-class - BinaryData deviceClassPatch = BinaryData.fromString("{\"friendlyName\":\"GA Webcams\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.updateDeviceClassWithResponse("deviceClassId", deviceClassPatch, requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-management-update-device-class.device-management-update-device-class - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.java deleted file mode 100644 index d182cfa57e2d..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdate.java +++ /dev/null @@ -1,27 +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.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; - -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.device-update-delete-update.device-update-delete-update - RequestOptions requestOptions = new RequestOptions(); - SyncPoller response - = deviceUpdateClient.beginDeleteUpdate("microsoft", "adu", "1.0.0.0", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-delete-update.device-update-delete-update - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.java deleted file mode 100644 index 4c957b2391af..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFile.java +++ /dev/null @@ -1,27 +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.DeviceUpdateClient; -import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; - -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.device-update-get-file.device-update-get-file - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceUpdateClient.getFileWithResponse("microsoft", "adu", "1.0.0.0", "abc123", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-get-file.device-update-get-file - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.java deleted file mode 100644 index 1571f39637ad..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatus.java +++ /dev/null @@ -1,27 +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.DeviceUpdateClient; -import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; - -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.device-update-get-operation-status.device-update-get-operation-status - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceUpdateClient.getOperationStatusWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-get-operation-status.device-update-get-operation-status - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.java deleted file mode 100644 index efee03cdc4b5..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdate.java +++ /dev/null @@ -1,27 +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.DeviceUpdateClient; -import com.azure.iot.deviceupdate.DeviceUpdateClientBuilder; - -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.device-update-get-update.device-update-get-update - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceUpdateClient.getUpdateWithResponse("microsoft", "adu", "1.0.0.0", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-get-update.device-update-get-update - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.java deleted file mode 100644 index 9a85ea1414cc..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdate.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.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; - -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.device-update-import-update.device-update-import-update - 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.device-update-import-update.device-update-import-update - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.java deleted file mode 100644 index f4dd0d46ca1b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFiles.java +++ /dev/null @@ -1,27 +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.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.device-update-list-files.device-update-list-files - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceUpdateClient.listFiles("microsoft", "adu", "1.0.0.0", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-list-files.device-update-list-files - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java deleted file mode 100644 index d9cd6292ac8b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNames.java +++ /dev/null @@ -1,26 +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.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.device-update-list-names.device-update-list-names - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listNames("microsoft", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-list-names.device-update-list-names - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java deleted file mode 100644 index 363633a83032..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatuses.java +++ /dev/null @@ -1,26 +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.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 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.device-update-list-operation-statuses.device-update-list-operation-statuses - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listOperationStatuses(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-list-operation-statuses.device-update-list-operation-statuses - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java deleted file mode 100644 index bd0de5fb19e1..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProviders.java +++ /dev/null @@ -1,26 +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.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.device-update-list-providers.device-update-list-providers - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listProviders(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-list-providers.device-update-list-providers - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java deleted file mode 100644 index 0bb27c34dd33..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdates.java +++ /dev/null @@ -1,26 +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.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 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.device-update-list-updates.device-update-list-updates - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listUpdates(requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-list-updates.device-update-list-updates - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java deleted file mode 100644 index 86bd6e744f39..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/samples/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersions.java +++ /dev/null @@ -1,26 +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.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.device-update-list-versions.device-update-list-versions - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listVersions("microsoft", "adu", requestOptions); - // END:com.azure.iot.deviceupdate.generated.device-update-list-versions.device-update-list-versions - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeploymentTests.java deleted file mode 100644 index 4948033b557b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCancelOrRetryDeploymentTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementCancelOrRetryDeploymentTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementCancelOrRetryDeploymentTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.stopDeploymentWithResponse("TestGroup", "deviceClassId", - "deploymentId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentId\":\"deploymentId\",\"groupId\":\"TestGroup\",\"isCanceled\":true,\"isRetried\":false,\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java deleted file mode 100644 index 30cc991e8bf2..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementCreateOrUpdateDeploymentTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementCreateOrUpdateDeploymentTests() { - 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); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentId\":\"deploymentId\",\"deviceClassSubgroups\":[\"deviceClassId1\",\"deviceClassId2\"],\"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\"}}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests.java deleted file mode 100644 index 118fa5df8bbf..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests.java +++ /dev/null @@ -1,22 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementDeleteDeploymentForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementDeleteDeploymentForDeviceClassSubgroupTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteDeploymentForDeviceClassSubgroupWithResponse("TestGroup", - "deviceClassId", "deploymentId", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java deleted file mode 100644 index 0b8d619f2134..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java +++ /dev/null @@ -1,22 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementDeleteDeploymentTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementDeleteDeploymentTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.deleteDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java deleted file mode 100644 index 623a670144ea..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java +++ /dev/null @@ -1,22 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementDeleteDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementDeleteDeviceClassSubgroupTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.deleteDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java deleted file mode 100644 index 6ab04a03d73c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java +++ /dev/null @@ -1,21 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementDeleteDeviceClassTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementDeleteDeviceClassTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteDeviceClassWithResponse("deviceClass1", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroupTests.java deleted file mode 100644 index 29bef64f1010..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementDeleteGroupTests.java +++ /dev/null @@ -1,21 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementDeleteGroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementDeleteGroupTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.deleteGroupWithResponse("group1", requestOptions); - Assertions.assertEquals(204, response.getStatusCode()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java deleted file mode 100644 index 698a6f172738..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetDeploymentForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetDeploymentForDeviceClassSubgroupTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentId\":\"deploymentId\",\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"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\"}}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java deleted file mode 100644 index 06cfcbb99882..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetDeploymentStatusTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetDeploymentStatusTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeploymentStatusWithResponse("TestGroup", "deploymentId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentState\":\"ActiveWithSubgroupFailures\",\"groupId\":\"TestGroup\",\"subgroupStatus\":[{\"deploymentState\":\"Active\",\"deviceClassId\":\"deviceClassId1\",\"devicesCanceledCount\":0,\"devicesCompletedFailedCount\":0,\"devicesCompletedSucceededCount\":1,\"devicesInProgressCount\":0,\"groupId\":\"TestGroup\",\"totalDevices\":1},{\"deploymentState\":\"Failed\",\"deviceClassId\":\"deviceClassId2\",\"devicesCanceledCount\":0,\"devicesCompletedFailedCount\":1,\"devicesCompletedSucceededCount\":1,\"devicesInProgressCount\":0,\"error\":{\"code\":\"ADMConfigurationLimitExceeded\",\"message\":\"The subgroup deployment failed to be created due to hitting the ADM configuration limit\"},\"groupId\":\"TestGroup\",\"totalDevices\":2}]}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentTests.java deleted file mode 100644 index 5f2a688d3839..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeploymentTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetDeploymentTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetDeploymentTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentId\":\"deploymentId\",\"deviceClassSubgroups\":[\"deviceClassId1\",\"deviceClassId2\"],\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"description\":\"This update fixes a security issue.\",\"friendlyName\":\"Contoso Toaster v1.2.3.3\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.3\"}}},\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"description\":\"This update fixes a security issue.\",\"friendlyName\":\"Contoso Toaster v1.2.3.4\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java deleted file mode 100644 index 0ad649fa38e1..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetDeviceClassSubgroupDeploymentStatusTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentState\":\"Active\",\"deviceClassId\":\"deviceClassId\",\"devicesCanceledCount\":0,\"devicesCompletedFailedCount\":0,\"devicesCompletedSucceededCount\":1,\"devicesInProgressCount\":0,\"groupId\":\"TestGroup\",\"totalDevices\":1}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java deleted file mode 100644 index d8c94dc9a2ec..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetDeviceClassSubgroupUpdateComplianceTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient - .getDeviceClassSubgroupUpdateComplianceWithResponse("group1", "deviceClassId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"newUpdatesAvailableDeviceCount\":36265,\"onLatestUpdateDeviceCount\":256873,\"totalDeviceCount\":302204,\"updatesInProgressDeviceCount\":9066}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java deleted file mode 100644 index 2d5af24489ab..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetDeviceClassTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetDeviceClassTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeviceClassWithResponse("deviceClassId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"bestCompatibleUpdate\":{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.0.0.0\"}},\"deviceClassId\":\"deviceClassId\",\"deviceClassProperties\":{\"compatProperties\":{\"manufacturer\":\"manufacturer1\",\"model\":\"model1\"},\"contractModel\":{\"name\":\"Device Update Model V2\",\"id\":\"dtmi:azure:iot:deviceUpdateContractModel;2\"}},\"friendlyName\":\"DeviceClass2020-04-22T12:12:12.0000000+00:00\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceTests.java deleted file mode 100644 index c1f39d11e6ef..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetDeviceTests.java +++ /dev/null @@ -1,25 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetDeviceTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetDeviceTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getDeviceWithResponse("deviceId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentStatus\":\"Failed\",\"deviceClassId\":\"deviceClass1\",\"deviceId\":\"device1\",\"installedUpdate\":{\"description\":\"Fixes security issue.\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}},\"lastAttemptedUpdate\":{\"description\":\"Fixes performance issue.\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"2.0.0.0\"}},\"lastInstallResult\":{\"extendedResultCode\":0,\"resultCode\":200,\"resultDetails\":\"\",\"stepResults\":[{\"extendedResultCode\":0,\"resultCode\":200,\"resultDetails\":\"\",\"update\":{\"friendlyName\":\"Microsoft Peripheral Camera 1.0\",\"updateId\":{\"name\":\"peripheralcamera\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}},{\"extendedResultCode\":0,\"resultCode\":200,\"resultDetails\":\"\",\"update\":{\"friendlyName\":\"Microsoft Peripheral Speaker 1.0\",\"updateId\":{\"name\":\"peripheralspeaker\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}}]},\"onLatestUpdate\":false}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupTests.java deleted file mode 100644 index 0f461660977b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupTests.java +++ /dev/null @@ -1,25 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetGroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetGroupTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getGroupWithResponse("group1", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deviceCount\":149,\"groupId\":\"MyGroup\",\"groupType\":\"IoTHubTag\",\"subgroupsWithNewUpdatesAvailableCount\":3,\"subgroupsWithOnLatestUpdateCount\":1,\"subgroupsWithUpdatesInProgressCount\":0}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateComplianceTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateComplianceTests.java deleted file mode 100644 index 5dfd3a019216..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetGroupUpdateComplianceTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetGroupUpdateComplianceTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetGroupUpdateComplianceTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deploymentId\":\"MyDeployment\",\"deviceClassId\":\"DeviceClassId\",\"deviceCount\":149,\"groupId\":\"group1\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatusTests.java deleted file mode 100644 index 572fc0f0e162..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionDetailedStatusTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetLogCollectionDetailedStatusTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetLogCollectionDetailedStatusTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getLogCollectionDetailedStatusWithResponse("LogCollectionId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"LogCollectionId\",\"description\":\"Log collection description\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceStatus\":[{\"deviceId\":\"DeviceA\",\"extendedResultCode\":\"0\",\"logLocation\":\"/storageAccount/deviceUpdateInstanceName/DeviceA/LogCollectionId\",\"resultCode\":\"200\",\"status\":\"NotStarted\"},{\"deviceId\":\"DeviceB\",\"extendedResultCode\":\"0\",\"logLocation\":\"/storageAccount/deviceUpdateInstanceName/DeviceB/ModuleB/LogCollectionId\",\"moduleId\":\"ModuleB\",\"resultCode\":\"200\",\"status\":\"NotStarted\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionTests.java deleted file mode 100644 index 3100eeaa01e7..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetLogCollectionTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetLogCollectionTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetLogCollectionTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getLogCollectionWithResponse("LogCollectionId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"LogCollectionId\",\"description\":\"Log collection description\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatusTests.java deleted file mode 100644 index 5935e71605a3..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetOperationStatusTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetOperationStatusTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetOperationStatusTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient - .getOperationStatusWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroupTests.java deleted file mode 100644 index fa5068a92a4f..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceForGroupTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetUpdateComplianceForGroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetUpdateComplianceForGroupTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.getUpdateComplianceForGroupWithResponse("group1", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"newUpdatesAvailableDeviceCount\":36265,\"onLatestUpdateDeviceCount\":256873,\"totalDeviceCount\":302204,\"updatesInProgressDeviceCount\":9066}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java deleted file mode 100644 index 0aadd5edfd3b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java +++ /dev/null @@ -1,25 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementGetUpdateComplianceTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementGetUpdateComplianceTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient.getUpdateComplianceWithResponse(requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"newUpdatesAvailableDeviceCount\":36265,\"onLatestUpdateDeviceCount\":256873,\"totalDeviceCount\":302204,\"updatesInProgressDeviceCount\":9066}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevicesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevicesTests.java deleted file mode 100644 index 43f1f749f8da..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementImportDevicesTests.java +++ /dev/null @@ -1,26 +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.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.SyncPoller; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementImportDevicesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementImportDevicesTests() { - BinaryData importType = BinaryData.fromString("\"All\""); - RequestOptions requestOptions = new RequestOptions(); - SyncPoller response - = setPlaybackSyncPollerPollInterval(deviceManagementClient.beginImportDevices(importType, requestOptions)); - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - response.waitForCompletion().getStatus()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroupTests.java deleted file mode 100644 index e975859161b0..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroupTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListBestUpdatesForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListBestUpdatesForDeviceClassSubgroupTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response = deviceManagementClient - .getBestUpdatesForDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deviceClassId\":\"deviceClassId\",\"deviceCount\":100,\"groupId\":\"group1\",\"update\":{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.0.0.0\"}}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java deleted file mode 100644 index 02da9b1814c4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListBestUpdatesForGroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListBestUpdatesForGroupTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listBestUpdatesForGroup("group1", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deviceClassId\":\"deviceClassId1\",\"deviceCount\":100,\"groupId\":\"group1\",\"update\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}}}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java deleted file mode 100644 index ca003c7aaada..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java +++ /dev/null @@ -1,26 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListDeploymentsForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListDeploymentsForDeviceClassSubgroupTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDeploymentsForDeviceClassSubgroup("TestGroup", - "deviceClassId1", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentId\":\"deploymentId1\",\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"0.9.0\"}}},\"startDateTime\":\"2020-07-01T12:13:14Z\",\"update\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}}}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java deleted file mode 100644 index 5e32f6e7ca10..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java +++ /dev/null @@ -1,26 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListDeploymentsForGroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListDeploymentsForGroupTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listDeploymentsForGroup("TestGroup", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentId\":\"deploymentId1\",\"deviceClassSubgroups\":[\"deviceClassId1\",\"deviceClassId2\"],\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"friendlyName\":\"Provider1 Name1 2022 Update\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"0.9.0\"}}},\"startDateTime\":\"2020-07-01T12:13:14Z\",\"update\":{\"friendlyName\":\"Provider1 Name1 2022 Update\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}}}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java deleted file mode 100644 index b38de574c721..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java +++ /dev/null @@ -1,26 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListDeviceClassSubgroupsForGroupTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListDeviceClassSubgroupsForGroupTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listDeviceClassSubgroupsForGroup("group1", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deploymentId\":\"MyDeployment\",\"deviceClassId\":\"DeviceClassId\",\"deviceCount\":149,\"groupId\":\"group1\"}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java deleted file mode 100644 index 42f8faab6c9d..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListDeviceClassesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListDeviceClassesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDeviceClasses(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"bestCompatibleUpdate\":{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.0.0.0\"}},\"deviceClassId\":\"deviceClassId\",\"deviceClassProperties\":{\"compatProperties\":{\"manufacturer\":\"manufacturer1\",\"model\":\"model1\"},\"contractModel\":{\"name\":\"Device Update Model V2\",\"id\":\"dtmi:azure:iot:deviceUpdateContractModel;2\"}},\"friendlyName\":\"DeviceClass2020-04-22T12:12:12.0000000+00:00\"}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests.java deleted file mode 100644 index 01a9270541ba..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests.java +++ /dev/null @@ -1,27 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests - extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListDeviceStatesForDeviceClassSubgroupDeploymentTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment( - "TestGroup", "deviceClassId", "deploymentId", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deviceId\":\"deviceId1\",\"deviceState\":\"Succeeded\",\"movedOnToNewDeployment\":false,\"retryCount\":1}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevicesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevicesTests.java deleted file mode 100644 index 2006d8c36ab4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListDevicesTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListDevicesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListDevicesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listDevices(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deploymentStatus\":\"Failed\",\"deviceClassId\":\"deviceClassId1\",\"deviceId\":\"device1\",\"installedUpdate\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}},\"lastAttemptedUpdate\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"2.0.0.0\"}},\"lastDeploymentId\":\"myDeployment123\",\"onLatestUpdate\":false}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroupsTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroupsTests.java deleted file mode 100644 index fe055702bc09..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListGroupsTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListGroupsTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListGroupsTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listGroups(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deployments\":[\"deployment1\",\"deployment2\"],\"deviceCount\":100,\"groupId\":\"MyGroup1\",\"groupType\":\"IoTHubTag\",\"subgroupsWithNewUpdatesAvailableCount\":2,\"subgroupsWithOnLatestUpdateCount\":1,\"subgroupsWithUpdatesInProgressCount\":0}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevicesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevicesTests.java deleted file mode 100644 index 4b58c6708928..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListHealthOfDevicesTests.java +++ /dev/null @@ -1,26 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListHealthOfDevicesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListHealthOfDevicesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listHealthOfDevices("state eq 'unhealthy'", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"deviceId\":\"device1\",\"digitalTwinModelId\":\"dtmi:foo;1\",\"healthChecks\":[{\"name\":\"check1\",\"result\":\"success\"},{\"name\":\"check2\",\"result\":\"userError\"}],\"moduleId\":\"module1\",\"state\":\"unhealthy\"}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java deleted file mode 100644 index ac2f42e7e248..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java +++ /dev/null @@ -1,26 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListInstallableUpdatesForDeviceClassTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListInstallableUpdatesForDeviceClassTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceManagementClient.listInstallableUpdatesForDeviceClass("deviceClassId", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollectionsTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollectionsTests.java deleted file mode 100644 index 3f9969865cc3..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListLogCollectionsTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListLogCollectionsTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListLogCollectionsTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listLogCollections(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"LogCollectionId\",\"description\":\"Log collection description\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatusesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatusesTests.java deleted file mode 100644 index 03dd9276f7dc..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementListOperationStatusesTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementListOperationStatusesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementListOperationStatusesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceManagementClient.listOperationStatuses(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\"}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollectionTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollectionTests.java deleted file mode 100644 index 3e9320ac4d5b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementStartLogCollectionTests.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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementStartLogCollectionTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementStartLogCollectionTests() { - 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); - Assertions.assertEquals(201, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"LogCollectionId\",\"description\":\"og collection description\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java deleted file mode 100644 index b558b5b669b7..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java +++ /dev/null @@ -1,27 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceManagementUpdateDeviceClassTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceManagementUpdateDeviceClassTests() { - BinaryData deviceClassPatch = BinaryData.fromString("{\"friendlyName\":\"GA Webcams\"}"); - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceManagementClient.updateDeviceClassWithResponse("deviceClassId", deviceClassPatch, requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"bestCompatibleUpdate\":{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.0.0.0\"}},\"deviceClassId\":\"deviceClassId\",\"deviceClassProperties\":{\"compatProperties\":{\"manufacturer\":\"manufacturer1\",\"model\":\"model1\"},\"contractModel\":{\"name\":\"Device Update Model V2\",\"id\":\"dtmi:azure:iot:deviceUpdateContractModel;2\"}},\"friendlyName\":\"GA Webcams\"}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateClientTestBase.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateClientTestBase.java deleted file mode 100644 index bba88b595356..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateClientTestBase.java +++ /dev/null @@ -1,61 +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; - -// 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.DeviceManagementClientBuilder; -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.buildClient(); - - DeviceManagementClientBuilder deviceManagementClientbuilder = new DeviceManagementClientBuilder() - .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.buildClient(); - - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java deleted file mode 100644 index c21646a65399..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java +++ /dev/null @@ -1,25 +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.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.SyncPoller; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateDeleteUpdateTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateDeleteUpdateTests() { - RequestOptions requestOptions = new RequestOptions(); - SyncPoller response = setPlaybackSyncPollerPollInterval( - deviceUpdateClient.beginDeleteUpdate("microsoft", "adu", "1.0.0.0", requestOptions)); - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - response.waitForCompletion().getStatus()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFileTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFileTests.java deleted file mode 100644 index 35c3dc52e122..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetFileTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateGetFileTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateGetFileTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceUpdateClient.getFileWithResponse("microsoft", "adu", "1.0.0.0", "abc123", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"etag\":\"\\\"26bd8eba-4bb2-4960-a357-ca4d60b5fb4b\\\"\",\"fileId\":\"abc123\",\"fileName\":\"1v5uww1q.my2\",\"hashes\":{\"sha256\":\"OVokcktf61lQXs17MzJCsM98lk48H1Wu1hy7Sp6lLfI=\"},\"mimeType\":\"application/BuildAsync-s4jwikgq.44h\",\"sizeInBytes\":1862311}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatusTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatusTests.java deleted file mode 100644 index 13a0d39c982e..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetOperationStatusTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateGetOperationStatusTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateGetOperationStatusTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceUpdateClient.getOperationStatusWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"resourceLocation\":\"/deviceUpdate/blue/updates/providers/microsoft/names/adu/versions/1.0.0.0?api-version=2022-10-01\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\",\"update\":{\"friendlyName\":\"Microsoft ADU v1\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdateTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdateTests.java deleted file mode 100644 index ff57b53e498f..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateGetUpdateTests.java +++ /dev/null @@ -1,26 +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 org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateGetUpdateTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateGetUpdateTests() { - RequestOptions requestOptions = new RequestOptions(); - Response response - = deviceUpdateClient.getUpdateWithResponse("microsoft", "adu", "1.0.0.0", requestOptions); - Assertions.assertEquals(200, response.getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"description\":\"Fix for critical vulnerability\",\"compatibility\":[{\"deviceManufacturer\":\"Microsoft\",\"deviceModel\":\"Toaster\"}],\"createdDateTime\":\"2019-09-12T00:00:00.0000000+00:00\",\"etag\":\"\\\"3fed3378-0c67-47d2-b796-296962c66cbb\\\"\",\"friendlyName\":\"Lab Sensor Update v1\",\"importedDateTime\":\"2020-04-22T21:01:43.8408797+00:00\",\"instructions\":{\"steps\":[{\"description\":\"pre-install script\",\"files\":[\"configure.sh\"],\"handler\":\"microsoft/script:1\",\"handlerProperties\":{\"arguments\":\"--pre-install\"}},{\"type\":\"reference\",\"updateId\":{\"name\":\"sensor\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}]},\"manifestVersion\":\"5.0\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}") - .toObject(Object.class), response.getValue().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdateTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdateTests.java deleted file mode 100644 index 78d78d040975..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateImportUpdateTests.java +++ /dev/null @@ -1,27 +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.util.BinaryData; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.SyncPoller; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateImportUpdateTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateImportUpdateTests() { - 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 - = setPlaybackSyncPollerPollInterval(deviceUpdateClient.beginImportUpdate(updateToImport, requestOptions)); - Assertions.assertEquals(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, - response.waitForCompletion().getStatus()); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFilesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFilesTests.java deleted file mode 100644 index 882b9269b37c..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListFilesTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateListFilesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateListFilesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response - = deviceUpdateClient.listFiles("microsoft", "adu", "1.0.0.0", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString("\"abc123\"").toObject(Object.class), - response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNamesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNamesTests.java deleted file mode 100644 index d791102c0ea2..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListNamesTests.java +++ /dev/null @@ -1,24 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateListNamesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateListNamesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listNames("microsoft", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString("\"adu\"").toObject(Object.class), - response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatusesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatusesTests.java deleted file mode 100644 index 7d7243c6a600..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListOperationStatusesTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateListOperationStatusesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateListOperationStatusesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listOperationStatuses(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"resourceLocation\":\"/deviceUpdate/blue/updates/providers/microsoft/names/adu/versions/1.0.0.0?api-version=2022-10-01\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\",\"update\":{\"friendlyName\":\"Microsoft ADU v1\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProvidersTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProvidersTests.java deleted file mode 100644 index 3b12ddfd458b..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListProvidersTests.java +++ /dev/null @@ -1,24 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateListProvidersTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateListProvidersTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listProviders(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString("\"microsoft\"").toObject(Object.class), - response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdatesTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdatesTests.java deleted file mode 100644 index 4c2b46f26dca..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListUpdatesTests.java +++ /dev/null @@ -1,25 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateListUpdatesTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateListUpdatesTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listUpdates(requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString( - "{\"description\":\"Example update.\",\"compatibility\":[{\"deviceManufacturer\":\"Microsoft\",\"deviceModel\":\"Toaster\"}],\"createdDateTime\":\"2019-09-12T00:00:00.0000000+00:00\",\"etag\":\"\\\"3fed3378-0c67-47d2-b796-296962c66cbb\\\"\",\"importedDateTime\":\"2020-04-22T21:01:43.8408797+00:00\",\"instructions\":{\"steps\":[{\"description\":\"pre-install script\",\"files\":[\"configure.sh\"],\"handler\":\"microsoft/script:1\",\"handlerProperties\":{\"arguments\":\"--pre-install\"}},{\"type\":\"reference\",\"updateId\":{\"name\":\"sensor\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}]},\"manifestVersion\":\"5.0\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}") - .toObject(Object.class), response.iterator().next().toObject(Object.class)); - } -} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersionsTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersionsTests.java deleted file mode 100644 index 057d33dbbee4..000000000000 --- a/sdk/deviceupdate/azure-iot-deviceupdate/swagger/src/test/java/com/azure/iot/deviceupdate/generated/DeviceUpdateListVersionsTests.java +++ /dev/null @@ -1,24 +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.PagedIterable; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.util.BinaryData; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -public final class DeviceUpdateListVersionsTests extends DeviceUpdateClientTestBase { - @Test - @Disabled - public void testDeviceUpdateListVersionsTests() { - RequestOptions requestOptions = new RequestOptions(); - PagedIterable response = deviceUpdateClient.listVersions("microsoft", "adu", requestOptions); - Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); - Assertions.assertEquals(BinaryData.fromString("\"1.0.0.0\"").toObject(Object.class), - response.iterator().next().toObject(Object.class)); - } -} 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..e598f0b5b9a9 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/deviceupdate/data-plane/duiothub +commit: a66d184ae2c620a3649584bc18975a8cedee83b8 +repo: Azure/azure-rest-api-specs +additionalDirectories: