diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/assets.json b/sdk/deviceupdate/azure-iot-deviceupdate/assets.json index ebed1e967baa..0d79c9c10a09 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_6e7c02a488" + "Tag": "java/deviceupdate/azure-iot-deviceupdate_e6c0b7421b" } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/config.yaml b/sdk/deviceupdate/azure-iot-deviceupdate/config.yaml new file mode 100644 index 000000000000..5ae98eb4605e --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/config.yaml @@ -0,0 +1,30 @@ +use: '@autorest/java@4.1.17' +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 +regenerate-pom: false +title: DeviceUpdateClient +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +service-interface-as-public: true +add-context-parameter: 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 +context-client-method-parameter: true +azure-arm: false +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}) \ No newline at end of file diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml b/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml index 22db78c9d839..e49be0660f7d 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml +++ b/sdk/deviceupdate/azure-iot-deviceupdate/pom.xml @@ -29,6 +29,10 @@ 0.25 0.1 + + + --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED + 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 1be74d117a24..934db9a82182 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 @@ -17,20 +17,21 @@ 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 DeviceManagementAsyncClient client; + @Generated private final DeviceManagementsImpl serviceClient; /** * Initializes an instance of DeviceManagementClient class. * - * @param client the async client. + * @param serviceClient the service client implementation. */ @Generated - DeviceManagementClient(DeviceManagementAsyncClient client) { - this.client = client; + DeviceManagementClient(DeviceManagementsImpl serviceClient) { + this.serviceClient = serviceClient; } /** @@ -92,7 +93,7 @@ public final class DeviceManagementClient { @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceClasses(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listDeviceClasses(requestOptions)); + return this.serviceClient.listDeviceClasses(requestOptions); } /** @@ -136,7 +137,7 @@ public PagedIterable listDeviceClasses(RequestOptions requestOptions @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - return this.client.getDeviceClassWithResponse(deviceClassId, requestOptions).block(); + return this.serviceClient.getDeviceClassWithResponse(deviceClassId, requestOptions); } /** @@ -190,7 +191,7 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req @ServiceMethod(returns = ReturnType.SINGLE) public Response updateDeviceClassWithResponse( String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions) { - return this.client.updateDeviceClassWithResponse(deviceClassId, deviceClassPatch, requestOptions).block(); + return this.serviceClient.updateDeviceClassWithResponse(deviceClassId, deviceClassPatch, requestOptions); } /** @@ -211,7 +212,7 @@ public Response updateDeviceClassWithResponse( @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - return this.client.deleteDeviceClassWithResponse(deviceClassId, requestOptions).block(); + return this.serviceClient.deleteDeviceClassWithResponse(deviceClassId, requestOptions); } /** @@ -248,7 +249,7 @@ public Response deleteDeviceClassWithResponse(String deviceClassId, Reques @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listInstallableUpdatesForDeviceClass( String deviceClassId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listInstallableUpdatesForDeviceClass(deviceClassId, requestOptions)); + return this.serviceClient.listInstallableUpdatesForDeviceClass(deviceClassId, requestOptions); } /** @@ -318,7 +319,7 @@ public PagedIterable listInstallableUpdatesForDeviceClass( @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDevices(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listDevices(requestOptions)); + return this.serviceClient.listDevices(requestOptions); } /** @@ -342,7 +343,7 @@ public PagedIterable listDevices(RequestOptions requestOptions) { @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginImportDevices(BinaryData importType, RequestOptions requestOptions) { - return this.client.beginImportDevices(importType, requestOptions).getSyncPoller(); + return this.serviceClient.beginImportDevices(importType, requestOptions); } /** @@ -398,7 +399,7 @@ public SyncPoller beginImportDevices(BinaryData importTy @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { - return this.client.getDeviceWithResponse(deviceId, requestOptions).block(); + return this.serviceClient.getDeviceWithResponse(deviceId, requestOptions); } /** @@ -457,7 +458,7 @@ public Response getDeviceWithResponse(String deviceId, RequestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceModuleWithResponse( String deviceId, String moduleId, RequestOptions requestOptions) { - return this.client.getDeviceModuleWithResponse(deviceId, moduleId, requestOptions).block(); + return this.serviceClient.getDeviceModuleWithResponse(deviceId, moduleId, requestOptions); } /** @@ -486,7 +487,7 @@ public Response getDeviceModuleWithResponse( @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getUpdateComplianceWithResponse(RequestOptions requestOptions) { - return this.client.getUpdateComplianceWithResponse(requestOptions).block(); + return this.serviceClient.getUpdateComplianceWithResponse(requestOptions); } /** @@ -534,7 +535,7 @@ public Response getUpdateComplianceWithResponse(RequestOptions reque @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listGroups(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listGroups(requestOptions)); + return this.serviceClient.listGroups(requestOptions); } /** @@ -568,7 +569,7 @@ public PagedIterable listGroups(RequestOptions requestOptions) { @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.client.getGroupWithResponse(groupId, requestOptions).block(); + return this.serviceClient.getGroupWithResponse(groupId, requestOptions); } /** @@ -589,7 +590,7 @@ public Response getGroupWithResponse(String groupId, RequestOptions @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.client.deleteGroupWithResponse(groupId, requestOptions).block(); + return this.serviceClient.deleteGroupWithResponse(groupId, requestOptions); } /** @@ -619,7 +620,7 @@ public Response deleteGroupWithResponse(String groupId, RequestOptions req @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getUpdateComplianceForGroupWithResponse(String groupId, RequestOptions requestOptions) { - return this.client.getUpdateComplianceForGroupWithResponse(groupId, requestOptions).block(); + return this.serviceClient.getUpdateComplianceForGroupWithResponse(groupId, requestOptions); } /** @@ -661,7 +662,7 @@ public Response getUpdateComplianceForGroupWithResponse(String group @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listBestUpdatesForGroup(String groupId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listBestUpdatesForGroup(groupId, requestOptions)); + return this.serviceClient.listBestUpdatesForGroup(groupId, requestOptions); } /** @@ -725,7 +726,7 @@ public PagedIterable listBestUpdatesForGroup(String groupId, Request @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listDeploymentsForGroup(groupId, requestOptions)); + return this.serviceClient.listDeploymentsForGroup(groupId, requestOptions); } /** @@ -776,7 +777,7 @@ public PagedIterable listDeploymentsForGroup(String groupId, Request @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeploymentWithResponse( String groupId, String deploymentId, RequestOptions requestOptions) { - return this.client.getDeploymentWithResponse(groupId, deploymentId, requestOptions).block(); + return this.serviceClient.getDeploymentWithResponse(groupId, deploymentId, requestOptions); } /** @@ -860,9 +861,8 @@ public Response getDeploymentWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateDeploymentWithResponse( String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { - return this.client - .createOrUpdateDeploymentWithResponse(groupId, deploymentId, deployment, requestOptions) - .block(); + return this.serviceClient.createOrUpdateDeploymentWithResponse( + groupId, deploymentId, deployment, requestOptions); } /** @@ -881,7 +881,7 @@ public Response createOrUpdateDeploymentWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDeploymentWithResponse( String groupId, String deploymentId, RequestOptions requestOptions) { - return this.client.deleteDeploymentWithResponse(groupId, deploymentId, requestOptions).block(); + return this.serviceClient.deleteDeploymentWithResponse(groupId, deploymentId, requestOptions); } /** @@ -939,7 +939,7 @@ public Response deleteDeploymentWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeploymentStatusWithResponse( String groupId, String deploymentId, RequestOptions requestOptions) { - return this.client.getDeploymentStatusWithResponse(groupId, deploymentId, requestOptions).block(); + return this.serviceClient.getDeploymentStatusWithResponse(groupId, deploymentId, requestOptions); } /** @@ -984,7 +984,7 @@ public Response getDeploymentStatusWithResponse( @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceClassSubgroupsForGroup(String groupId, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listDeviceClassSubgroupsForGroup(groupId, requestOptions)); + return this.serviceClient.listDeviceClassSubgroupsForGroup(groupId, requestOptions); } /** @@ -1016,7 +1016,7 @@ public PagedIterable listDeviceClassSubgroupsForGroup(String groupId @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceClassSubgroupWithResponse( String groupId, String deviceClassId, RequestOptions requestOptions) { - return this.client.getDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).block(); + return this.serviceClient.getDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions); } /** @@ -1039,7 +1039,7 @@ public Response getDeviceClassSubgroupWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDeviceClassSubgroupWithResponse( String groupId, String deviceClassId, RequestOptions requestOptions) { - return this.client.deleteDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).block(); + return this.serviceClient.deleteDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions); } /** @@ -1072,9 +1072,8 @@ public Response deleteDeviceClassSubgroupWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceClassSubgroupUpdateComplianceWithResponse( String groupId, String deviceClassId, RequestOptions requestOptions) { - return this.client - .getDeviceClassSubgroupUpdateComplianceWithResponse(groupId, deviceClassId, requestOptions) - .block(); + return this.serviceClient.getDeviceClassSubgroupUpdateComplianceWithResponse( + groupId, deviceClassId, requestOptions); } /** @@ -1113,9 +1112,8 @@ public Response getDeviceClassSubgroupUpdateComplianceWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response getBestUpdatesForDeviceClassSubgroupWithResponse( String groupId, String deviceClassId, RequestOptions requestOptions) { - return this.client - .getBestUpdatesForDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions) - .block(); + return this.serviceClient.getBestUpdatesForDeviceClassSubgroupWithResponse( + groupId, deviceClassId, requestOptions); } /** @@ -1181,8 +1179,7 @@ public Response getBestUpdatesForDeviceClassSubgroupWithResponse( @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeploymentsForDeviceClassSubgroup( String groupId, String deviceClassId, RequestOptions requestOptions) { - return new PagedIterable<>( - this.client.listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions)); + return this.serviceClient.listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions); } /** @@ -1234,9 +1231,8 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup( @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeploymentForDeviceClassSubgroupWithResponse( String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return this.client - .getDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, deploymentId, requestOptions) - .block(); + return this.serviceClient.getDeploymentForDeviceClassSubgroupWithResponse( + groupId, deviceClassId, deploymentId, requestOptions); } /** @@ -1256,10 +1252,8 @@ public Response getDeploymentForDeviceClassSubgroupWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteDeploymentForDeviceClassSubgroupWithResponse( String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return this.client - .deleteDeploymentForDeviceClassSubgroupWithResponse( - groupId, deviceClassId, deploymentId, requestOptions) - .block(); + return this.serviceClient.deleteDeploymentForDeviceClassSubgroupWithResponse( + groupId, deviceClassId, deploymentId, requestOptions); } /** @@ -1311,7 +1305,7 @@ public Response deleteDeploymentForDeviceClassSubgroupWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response stopDeploymentWithResponse( String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return this.client.stopDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions).block(); + return this.serviceClient.stopDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions); } /** @@ -1363,7 +1357,7 @@ public Response stopDeploymentWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response retryDeploymentWithResponse( String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return this.client.retryDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions).block(); + return this.serviceClient.retryDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions); } /** @@ -1415,10 +1409,8 @@ public Response retryDeploymentWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) public Response getDeviceClassSubgroupDeploymentStatusWithResponse( String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return this.client - .getDeviceClassSubgroupDeploymentStatusWithResponse( - groupId, deviceClassId, deploymentId, requestOptions) - .block(); + return this.serviceClient.getDeviceClassSubgroupDeploymentStatusWithResponse( + groupId, deviceClassId, deploymentId, requestOptions); } /** @@ -1466,9 +1458,8 @@ public Response getDeviceClassSubgroupDeploymentStatusWithResponse( @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listDeviceStatesForDeviceClassSubgroupDeployment( String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return new PagedIterable<>( - this.client.listDeviceStatesForDeviceClassSubgroupDeployment( - groupId, deviceClassId, deploymentId, requestOptions)); + return this.serviceClient.listDeviceStatesForDeviceClassSubgroupDeployment( + groupId, deviceClassId, deploymentId, requestOptions); } /** @@ -1523,7 +1514,7 @@ public PagedIterable listDeviceStatesForDeviceClassSubgroupDeploymen @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { - return this.client.getOperationStatusWithResponse(operationId, requestOptions).block(); + return this.serviceClient.getOperationStatusWithResponse(operationId, requestOptions); } /** @@ -1583,7 +1574,7 @@ public Response getOperationStatusWithResponse(String operationId, R @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listOperationStatuses(requestOptions)); + return this.serviceClient.listOperationStatuses(requestOptions); } /** @@ -1638,7 +1629,7 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt @ServiceMethod(returns = ReturnType.SINGLE) public Response startLogCollectionWithResponse( String logCollectionId, BinaryData logCollection, RequestOptions requestOptions) { - return this.client.startLogCollectionWithResponse(logCollectionId, logCollection, requestOptions).block(); + return this.serviceClient.startLogCollectionWithResponse(logCollectionId, logCollection, requestOptions); } /** @@ -1673,7 +1664,7 @@ public Response startLogCollectionWithResponse( @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getLogCollectionWithResponse(String logCollectionId, RequestOptions requestOptions) { - return this.client.getLogCollectionWithResponse(logCollectionId, requestOptions).block(); + return this.serviceClient.getLogCollectionWithResponse(logCollectionId, requestOptions); } /** @@ -1712,7 +1703,7 @@ public Response getLogCollectionWithResponse(String logCollectionId, @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listLogCollections(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listLogCollections(requestOptions)); + return this.serviceClient.listLogCollections(requestOptions); } /** @@ -1752,7 +1743,7 @@ public PagedIterable listLogCollections(RequestOptions requestOption @ServiceMethod(returns = ReturnType.SINGLE) public Response getLogCollectionDetailedStatusWithResponse( String logCollectionId, RequestOptions requestOptions) { - return this.client.getLogCollectionDetailedStatusWithResponse(logCollectionId, requestOptions).block(); + return this.serviceClient.getLogCollectionDetailedStatusWithResponse(logCollectionId, requestOptions); } /** @@ -1792,6 +1783,6 @@ public Response getLogCollectionDetailedStatusWithResponse( @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listHealthOfDevices(String filter, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listHealthOfDevices(filter, requestOptions)); + return this.serviceClient.listHealthOfDevices(filter, requestOptions); } } 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 c5d97845e27b..9f4c2592fa81 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 @@ -38,7 +38,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; +import java.util.Objects; /** A builder for creating a new instance of the DeviceManagementClient type. */ @ServiceClientBuilder(serviceClients = {DeviceManagementClient.class, DeviceManagementAsyncClient.class}) @@ -54,7 +54,7 @@ public final class DeviceManagementClientBuilder @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://api.adu.microsoft.com/.default"}; @Generated - private final Map properties = CoreUtils.getProperties("azure-iot-deviceupdate.properties"); + private static final Map PROPERTIES = CoreUtils.getProperties("azure-iot-deviceupdate.properties"); @Generated private final List pipelinePolicies; @@ -133,6 +133,7 @@ public DeviceManagementClientBuilder retryOptions(RetryOptions retryOptions) { @Generated @Override public DeviceManagementClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); pipelinePolicies.add(customPolicy); return this; } @@ -251,28 +252,23 @@ private DeviceUpdateClientImpl buildInnerClient() { private HttpPipeline createHttpPipeline() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } - if (clientOptions == null) { - clientOptions = new ClientOptions(); - } + 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(clientOptions, httpLogOptions); + 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 = new HttpHeaders(); - clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); if (headers.getSize() > 0) { policies.add(new AddHeadersPolicy(headers)); } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + 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()); @@ -280,17 +276,16 @@ private HttpPipeline createHttpPipeline() { if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) - .clientOptions(clientOptions) + .clientOptions(localClientOptions) .build(); return httpPipeline; } @@ -312,6 +307,6 @@ public DeviceManagementAsyncClient buildAsyncClient() { */ @Generated public DeviceManagementClient buildClient() { - return new DeviceManagementClient(new DeviceManagementAsyncClient(buildInnerClient().getDeviceManagements())); + return new DeviceManagementClient(buildInnerClient().getDeviceManagements()); } } 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 b27ebe593072..46e7909935fa 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 @@ -17,20 +17,21 @@ 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 DeviceUpdateAsyncClient client; + @Generated private final DeviceUpdatesImpl serviceClient; /** * Initializes an instance of DeviceUpdateClient class. * - * @param client the async client. + * @param serviceClient the service client implementation. */ @Generated - DeviceUpdateClient(DeviceUpdateAsyncClient client) { - this.client = client; + DeviceUpdateClient(DeviceUpdatesImpl serviceClient) { + this.serviceClient = serviceClient; } /** @@ -107,7 +108,7 @@ public final class DeviceUpdateClient { @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listUpdates(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listUpdates(requestOptions)); + return this.serviceClient.listUpdates(requestOptions); } /** @@ -194,7 +195,7 @@ public PagedIterable listUpdates(RequestOptions requestOptions) { @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginImportUpdate( BinaryData updateToImport, RequestOptions requestOptions) { - return this.client.beginImportUpdate(updateToImport, requestOptions).getSyncPoller(); + return this.serviceClient.beginImportUpdate(updateToImport, requestOptions); } /** @@ -268,7 +269,7 @@ public SyncPoller beginImportUpdate( @ServiceMethod(returns = ReturnType.SINGLE) public Response getUpdateWithResponse( String provider, String name, String version, RequestOptions requestOptions) { - return this.client.getUpdateWithResponse(provider, name, version, requestOptions).block(); + return this.serviceClient.getUpdateWithResponse(provider, name, version, requestOptions); } /** @@ -289,7 +290,7 @@ public Response getUpdateWithResponse( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginDeleteUpdate( String provider, String name, String version, RequestOptions requestOptions) { - return this.client.beginDeleteUpdate(provider, name, version, requestOptions).getSyncPoller(); + return this.serviceClient.beginDeleteUpdate(provider, name, version, requestOptions); } /** @@ -317,7 +318,7 @@ public SyncPoller beginDeleteUpdate( @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listProviders(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listProviders(requestOptions)); + return this.serviceClient.listProviders(requestOptions); } /** @@ -346,7 +347,7 @@ public PagedIterable listProviders(RequestOptions requestOptions) { @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listNames(String provider, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listNames(provider, requestOptions)); + return this.serviceClient.listNames(provider, requestOptions); } /** @@ -386,7 +387,7 @@ public PagedIterable listNames(String provider, RequestOptions reque @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listVersions(provider, name, requestOptions)); + return this.serviceClient.listVersions(provider, name, requestOptions); } /** @@ -418,7 +419,7 @@ public PagedIterable listVersions(String provider, String name, Requ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listFiles( String provider, String name, String version, RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listFiles(provider, name, version, requestOptions)); + return this.serviceClient.listFiles(provider, name, version, requestOptions); } /** @@ -487,7 +488,7 @@ public PagedIterable listFiles( @ServiceMethod(returns = ReturnType.SINGLE) public Response getFileWithResponse( String provider, String name, String version, String fileId, RequestOptions requestOptions) { - return this.client.getFileWithResponse(provider, name, version, fileId, requestOptions).block(); + return this.serviceClient.getFileWithResponse(provider, name, version, fileId, requestOptions); } /** @@ -558,7 +559,7 @@ public Response getFileWithResponse( @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - return new PagedIterable<>(this.client.listOperationStatuses(requestOptions)); + return this.serviceClient.listOperationStatuses(requestOptions); } /** @@ -623,6 +624,6 @@ public PagedIterable listOperationStatuses(RequestOptions requestOpt @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { - return this.client.getOperationStatusWithResponse(operationId, requestOptions).block(); + return this.serviceClient.getOperationStatusWithResponse(operationId, requestOptions); } } 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 86d8e178e76f..961873b9c408 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 @@ -38,7 +38,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; +import java.util.Objects; /** A builder for creating a new instance of the DeviceUpdateClient type. */ @ServiceClientBuilder(serviceClients = {DeviceUpdateClient.class, DeviceUpdateAsyncClient.class}) @@ -54,7 +54,7 @@ public final class DeviceUpdateClientBuilder @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://api.adu.microsoft.com/.default"}; @Generated - private final Map properties = CoreUtils.getProperties("azure-iot-deviceupdate.properties"); + private static final Map PROPERTIES = CoreUtils.getProperties("azure-iot-deviceupdate.properties"); @Generated private final List pipelinePolicies; @@ -133,6 +133,7 @@ public DeviceUpdateClientBuilder retryOptions(RetryOptions retryOptions) { @Generated @Override public DeviceUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); pipelinePolicies.add(customPolicy); return this; } @@ -251,28 +252,23 @@ private DeviceUpdateClientImpl buildInnerClient() { private HttpPipeline createHttpPipeline() { Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } - if (clientOptions == null) { - clientOptions = new ClientOptions(); - } + 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(clientOptions, httpLogOptions); + 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 = new HttpHeaders(); - clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); if (headers.getSize() > 0) { policies.add(new AddHeadersPolicy(headers)); } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + 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()); @@ -280,17 +276,16 @@ private HttpPipeline createHttpPipeline() { if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) - .clientOptions(clientOptions) + .clientOptions(localClientOptions) .build(); return httpPipeline; } @@ -312,6 +307,6 @@ public DeviceUpdateAsyncClient buildAsyncClient() { */ @Generated public DeviceUpdateClient buildClient() { - return new DeviceUpdateClient(new DeviceUpdateAsyncClient(buildInnerClient().getDeviceUpdates())); + return new DeviceUpdateClient(buildInnerClient().getDeviceUpdates()); } } diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java index 5fcea42d7cdd..f3fc86eacf0b 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceManagementsImpl.java @@ -35,6 +35,8 @@ 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; @@ -90,7 +92,7 @@ Mono> listDeviceClasses( RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") + @Get("/deviceUpdate/{instanceId}/management/deviceClasses") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -102,16 +104,15 @@ Mono> listDeviceClasses( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeviceClass( + Response listDeviceClassesSync( @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}") + @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -123,18 +124,17 @@ Mono> getDeviceClass( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateDeviceClass( + Mono> getDeviceClass( @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}) + @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -145,7 +145,7 @@ Mono> updateDeviceClass( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteDeviceClass( + Response getDeviceClassSync( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, @PathParam("deviceClassId") String deviceClassId, @@ -154,7 +154,7 @@ Mono> deleteDeviceClass( RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") + @Patch("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -166,16 +166,17 @@ Mono> deleteDeviceClass( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listInstallableUpdatesForDeviceClass( + 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); - @Get("/deviceUpdate/{instanceId}/management/devices") + @Patch("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -187,16 +188,18 @@ Mono> listInstallableUpdatesForDeviceClass( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDevices( + 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); - @Post("/deviceUpdate/{instanceId}/management/devices:import") - @ExpectedResponses({202}) + @Delete("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") + @ExpectedResponses({204}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -207,17 +210,17 @@ Mono> listDevices( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> importDevices( + Mono> deleteDeviceClass( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("deviceClassId") String deviceClassId, @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}) + @Delete("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") + @ExpectedResponses({204}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -228,16 +231,16 @@ Mono> importDevices( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDevice( + Response deleteDeviceClassSync( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceId") String deviceId, + @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") + @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -249,17 +252,16 @@ Mono> getDevice( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeviceModule( + Mono> listInstallableUpdatesForDeviceClass( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("deviceId") String deviceId, - @PathParam("moduleId") String moduleId, + @PathParam("deviceClassId") String deviceClassId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/updateCompliance") + @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -271,15 +273,16 @@ Mono> getDeviceModule( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getUpdateCompliance( + 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/groups") + @Get("/deviceUpdate/{instanceId}/management/devices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -291,7 +294,7 @@ Mono> getUpdateCompliance( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listGroups( + Mono> listDevices( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, @QueryParam("api-version") String apiVersion, @@ -299,7 +302,7 @@ Mono> listGroups( RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") + @Get("/deviceUpdate/{instanceId}/management/devices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -311,17 +314,16 @@ Mono> listGroups( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getGroup( + Response listDevicesSync( @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}) + @Post("/deviceUpdate/{instanceId}/management/devices:import") + @ExpectedResponses({202}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -332,17 +334,17 @@ Mono> getGroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteGroup( + Mono> importDevices( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData importType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") - @ExpectedResponses({200}) + @Post("/deviceUpdate/{instanceId}/management/devices:import") + @ExpectedResponses({202}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -353,16 +355,16 @@ Mono> deleteGroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getUpdateComplianceForGroup( + Response importDevicesSync( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData importType, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") + @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -374,16 +376,16 @@ Mono> getUpdateComplianceForGroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listBestUpdatesForGroup( + Mono> getDevice( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, + @PathParam("deviceId") String deviceId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") + @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -395,16 +397,16 @@ Mono> listBestUpdatesForGroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeploymentsForGroup( + Response getDeviceSync( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, + @PathParam("deviceId") String deviceId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -416,17 +418,17 @@ Mono> listDeploymentsForGroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeployment( + Mono> getDeviceModule( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, + @PathParam("deviceId") String deviceId, + @PathParam("moduleId") String moduleId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -438,19 +440,18 @@ Mono> getDeployment( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createOrUpdateDeployment( + Response getDeviceModuleSync( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("groupId") String groupId, - @PathParam("deploymentId") String deploymentId, + @PathParam("deviceId") String deviceId, + @PathParam("moduleId") String moduleId, @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}) + @Get("/deviceUpdate/{instanceId}/management/updateCompliance") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -461,17 +462,15 @@ Mono> createOrUpdateDeployment( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteDeployment( + Mono> getUpdateCompliance( @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") + @Get("/deviceUpdate/{instanceId}/management/updateCompliance") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -483,17 +482,15 @@ Mono> deleteDeployment( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeploymentStatus( + Response getUpdateComplianceSync( @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") + @Get("/deviceUpdate/{instanceId}/management/groups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -505,16 +502,15 @@ Mono> getDeploymentStatus( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceClassSubgroupsForGroup( + Mono> listGroups( @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}") + @Get("/deviceUpdate/{instanceId}/management/groups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -526,18 +522,16 @@ Mono> listDeviceClassSubgroupsForGroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeviceClassSubgroup( + Response listGroupsSync( @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}) + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -548,18 +542,16 @@ Mono> getDeviceClassSubgroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteDeviceClassSubgroup( + Mono> getGroup( @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") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -571,18 +563,17 @@ Mono> deleteDeviceClassSubgroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeviceClassSubgroupUpdateCompliance( + Response getGroupSync( @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}) + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}") + @ExpectedResponses({204}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -593,18 +584,17 @@ Mono> getDeviceClassSubgroupUpdateCompliance( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getBestUpdatesForDeviceClassSubgroup( + Mono> deleteGroup( @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}) + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}") + @ExpectedResponses({204}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -615,18 +605,16 @@ Mono> getBestUpdatesForDeviceClassSubgroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeploymentsForDeviceClassSubgroup( + Response deleteGroupSync( @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}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -638,20 +626,17 @@ Mono> listDeploymentsForDeviceClassSubgroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeploymentForDeviceClassSubgroup( + Mono> getUpdateComplianceForGroup( @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}) + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -662,19 +647,16 @@ Mono> getDeploymentForDeviceClassSubgroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteDeploymentForDeviceClassSubgroup( + Response getUpdateComplianceForGroupSync( @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") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -686,19 +668,16 @@ Mono> deleteDeploymentForDeviceClassSubgroup( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> stopDeployment( + Mono> listBestUpdatesForGroup( @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") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -710,19 +689,16 @@ Mono> stopDeployment( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> retryDeployment( + Response listBestUpdatesForGroupSync( @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") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -734,19 +710,16 @@ Mono> retryDeployment( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getDeviceClassSubgroupDeploymentStatus( + Mono> listDeploymentsForGroup( @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") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -758,18 +731,16 @@ Mono> getDeviceClassSubgroupDeploymentStatus( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceStatesForDeviceClassSubgroupDeployment( + Response listDeploymentsForGroupSync( @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}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -781,16 +752,17 @@ Mono> listDeviceStatesForDeviceClassSubgroupDeployment( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getOperationStatus( + Mono> getDeployment( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String operationId, + @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/operations") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -802,16 +774,18 @@ Mono> getOperationStatus( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listOperationStatuses( + 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/deviceDiagnostics/logCollections/{operationId}") - @ExpectedResponses({201}) + @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -822,17 +796,18 @@ Mono> listOperationStatuses( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> startLogCollection( + Mono> createOrUpdateDeployment( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, + @PathParam("groupId") String groupId, + @PathParam("deploymentId") String deploymentId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData logCollection, + @BodyParam("application/json") BinaryData deployment, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}") + @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -844,17 +819,19 @@ Mono> startLogCollection( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLogCollection( + Response createOrUpdateDeploymentSync( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, + @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); - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections") - @ExpectedResponses({200}) + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({204}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -865,16 +842,18 @@ Mono> getLogCollection( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listLogCollections( + 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); - @Get("/deviceUpdate/{instanceId}/management/deviceDiagnostics/logCollections/{operationId}/detailedStatus") - @ExpectedResponses({200}) + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({204}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -885,16 +864,17 @@ Mono> listLogCollections( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLogCollectionDetailedStatus( + Response deleteDeploymentSync( @HostParam("endpoint") String endpoint, @PathParam(value = "instanceId", encoded = true) String instanceId, - @PathParam("operationId") String logCollectionId, + @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/deviceDiagnostics/deviceHealth") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -906,16 +886,17 @@ Mono> getLogCollectionDetailedStatus( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listHealthOfDevices( + 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("filter") String filter, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -927,14 +908,17 @@ Mono> listHealthOfDevices( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceClassesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -946,14 +930,16 @@ Mono> listDeviceClassesNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listInstallableUpdatesForDeviceClassNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + Mono> listDeviceClassSubgroupsForGroup( @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, + @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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -965,14 +951,16 @@ Mono> listInstallableUpdatesForDeviceClassNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDevicesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -984,14 +972,17 @@ Mono> listDevicesNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listGroupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -1003,14 +994,62 @@ Mono> listGroupsNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listBestUpdatesForGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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); - @Get("{nextLink}") + @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, @@ -1022,14 +1061,18 @@ Mono> listBestUpdatesForGroupNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeploymentsForGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get( + "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -1041,14 +1084,17 @@ Mono> listDeploymentsForGroupNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceClassSubgroupsForGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -1060,14 +1106,17 @@ Mono> listDeviceClassSubgroupsForGroupNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeploymentsForDeviceClassSubgroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -1079,14 +1128,17 @@ Mono> listDeploymentsForDeviceClassSubgroupNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listDeviceStatesForDeviceClassSubgroupDeploymentNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -1098,14 +1150,17 @@ Mono> listDeviceStatesForDeviceClassSubgroupDeploymentNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listOperationStatusesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -1117,14 +1172,18 @@ Mono> listOperationStatusesNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listLogCollectionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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("{nextLink}") + @Get( + "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -1136,150 +1195,1156 @@ Mono> listLogCollectionsNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listHealthOfDevicesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, + 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); - } - /** - * 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
-     * {
-     *     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)
-     *             }
-     *         }
-     *     ]
-     *     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 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) - public 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)); - } + @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); - /** - * 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
-     * {
-     *     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)
-     *             }
-     *         }
-     *     ]
-     *     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 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) + @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( @@ -1287,21 +2352,770 @@ public PagedFlux listDeviceClassesAsync(RequestOptions requestOption ? requestOptions.getContext() : Context.NONE); return new PagedFlux<>( - () -> listDeviceClassesSinglePageAsync(requestOptions), - nextLink -> listDeviceClassesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + () -> 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 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 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.
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} @@ -1310,31 +3124,37 @@ public PagedFlux listDeviceClassesAsync(RequestOptions requestOption * *

{@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)
-     *                 }
+     *     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)
+     *                 resultCode: int (Required)
+     *                 extendedResultCode: int (Required)
+     *                 resultDetails: String (Optional)
      *             }
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         ]
+     *     }
      * }
      * }
* @@ -1343,34 +3163,50 @@ 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 as paginated response with {@link PagedIterable}. + * @return a list of devices connected to Device Update for IoT Hub along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceClasses(RequestOptions requestOptions) { - return new PagedIterable<>(listDeviceClassesAsync(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); + return new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null); } /** - * Gets the properties of a device class. + * 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)
-     *     friendlyName: String (Optional)
-     *     deviceClassProperties (Required): {
-     *         contractModel (Optional): {
-     *             id: String (Required)
-     *             name: String (Required)
-     *         }
-     *         compatProperties (Required): {
-     *             String: String (Required)
-     *         }
-     *     }
-     *     bestCompatibleUpdate (Optional): {
+     *     groupId: String (Optional)
+     *     lastAttemptedUpdate (Optional): {
      *         updateId (Required): {
      *             provider: String (Required)
      *             name: String (Required)
@@ -1379,103 +3215,193 @@ public PagedIterable listDeviceClasses(RequestOptions requestOptions
      *         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 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}. + * @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) - public Mono> getDeviceClassWithResponseAsync( - String deviceClassId, RequestOptions requestOptions) { + private Mono> importDevicesWithResponseAsync(BinaryData importType, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getDeviceClass( + service.importDevices( this.client.getEndpoint(), this.client.getInstanceId(), - deviceClassId, this.client.getServiceVersion().getVersion(), + importType, accept, requestOptions, context)); } /** - * Gets the properties of a 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. * - *

Response Body Schema + *

Request 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)
-     *     }
-     * }
+     * String(Devices/Modules/All)
      * }
* - * @param deviceClassId Device class identifier. + * @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 properties of a device class along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { - return getDeviceClassWithResponseAsync(deviceClassId, requestOptions).block(); + 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); } /** - * Update device class details. + * 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
-     * {
-     *     friendlyName: String (Required)
-     * }
+     * 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)
-     *     friendlyName: String (Optional)
-     *     deviceClassProperties (Required): {
-     *         contractModel (Optional): {
-     *             id: String (Required)
-     *             name: String (Required)
-     *         }
-     *         compatProperties (Required): {
-     *             String: String (Required)
-     *         }
-     *     }
-     *     bestCompatibleUpdate (Optional): {
+     *     groupId: String (Optional)
+     *     lastAttemptedUpdate (Optional): {
      *         updateId (Required): {
      *             provider: String (Required)
      *             name: String (Required)
@@ -1484,62 +3410,63 @@ public Response getDeviceClassWithResponse(String deviceClassId, Req
      *         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 deviceClassId Device class identifier. - * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @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 device class metadata 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> updateDeviceClassWithResponseAsync( - String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions) { + public Mono> getDeviceWithResponseAsync(String deviceId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.updateDeviceClass( + service.getDevice( this.client.getEndpoint(), this.client.getInstanceId(), - deviceClassId, + deviceId, this.client.getServiceVersion().getVersion(), - deviceClassPatch, accept, requestOptions, context)); } /** - * Update device class details. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     friendlyName: String (Required)
-     * }
-     * }
+ * 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)
-     *     friendlyName: String (Optional)
-     *     deviceClassProperties (Required): {
-     *         contractModel (Optional): {
-     *             id: String (Required)
-     *             name: String (Required)
-     *         }
-     *         compatProperties (Required): {
-     *             String: String (Required)
-     *         }
-     *     }
-     *     bestCompatibleUpdate (Optional): {
+     *     groupId: String (Optional)
+     *     lastAttemptedUpdate (Optional): {
      *         updateId (Required): {
      *             provider: String (Required)
      *             name: String (Required)
@@ -1548,49 +3475,112 @@ public Mono> updateDeviceClassWithResponseAsync(
      *         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 deviceClassId Device class identifier. - * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @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 device class metadata 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 updateDeviceClassWithResponse( - String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions) { - return updateDeviceClassWithResponseAsync(deviceClassId, deviceClassPatch, requestOptions).block(); + 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); } /** - * 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. + * Gets the device module properties and latest deployment status for a device module connected to Device Update for + * IoT Hub. * - * @param deviceClassId Device class identifier. + *

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 {@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> deleteDeviceClassWithResponseAsync( - String deviceClassId, RequestOptions requestOptions) { + public Mono> getDeviceModuleWithResponseAsync( + String deviceId, String moduleId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.deleteDeviceClass( + service.getDeviceModule( this.client.getEndpoint(), this.client.getInstanceId(), - deviceClassId, + deviceId, + moduleId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -1598,170 +3588,153 @@ public Mono> deleteDeviceClassWithResponseAsync( } /** - * 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) { - return deleteDeviceClassWithResponseAsync(deviceClassId, requestOptions).block(); - } - - /** - * Gets a list of installable updates for a device class. + * Gets the device module properties and latest deployment status for a device module connected to Device Update for + * IoT Hub. * *

Response Body Schema * *

{@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             updateId (Required): {
-     *                 provider: String (Required)
-     *                 name: String (Required)
-     *                 version: String (Required)
-     *             }
-     *             description: String (Optional)
-     *             friendlyName: String (Optional)
+     *     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)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         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 deviceClassId Device class identifier. + * @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 a list of installable updates for a device class along with {@link PagedResponse} 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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listInstallableUpdatesForDeviceClassSinglePageAsync( - String deviceClassId, RequestOptions requestOptions) { + public Response getDeviceModuleWithResponse( + String deviceId, String moduleId, 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)); + return service.getDeviceModuleSync( + this.client.getEndpoint(), + this.client.getInstanceId(), + deviceId, + moduleId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + Context.NONE); } /** - * Gets a list of installable updates for a 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. * *

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)
+     *     totalDeviceCount: int (Required)
+     *     onLatestUpdateDeviceCount: int (Required)
+     *     newUpdatesAvailableDeviceCount: int (Required)
+     *     updatesInProgressDeviceCount: int (Required)
      * }
      * }
* - * @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}. + * @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.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)); + @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 a list of installable updates for a 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. * *

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)
+     *     totalDeviceCount: int (Required)
+     *     onLatestUpdateDeviceCount: int (Required)
+     *     newUpdatesAvailableDeviceCount: int (Required)
+     *     updatesInProgressDeviceCount: int (Required)
      * }
      * }
* - * @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}. + * @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.COLLECTION) - public PagedIterable listInstallableUpdatesForDeviceClass( - String deviceClassId, RequestOptions requestOptions) { - return new PagedIterable<>(listInstallableUpdatesForDeviceClassAsync(deviceClassId, requestOptions)); + @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 devices connected to Device Update for IoT Hub. + * Gets a list of all device groups. The $default group will always be returned first. * *

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).
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} @@ -1770,42 +3743,16 @@ public PagedIterable listInstallableUpdatesForDeviceClass( * *

{@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)
-     *                 }
-     *                 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)
-     *                     }
-     *                 ]
-     *             }
-     *         }
+     *     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)
      * }
      * }
* @@ -1814,15 +3761,14 @@ public PagedIterable listInstallableUpdatesForDeviceClass( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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}. + * @return a list of all device groups along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDevicesSinglePageAsync(RequestOptions requestOptions) { + private Mono> listGroupsSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listDevices( + service.listGroups( this.client.getEndpoint(), this.client.getInstanceId(), this.client.getServiceVersion().getVersion(), @@ -1841,14 +3787,14 @@ public Mono> listDevicesSinglePageAsync(RequestOptions } /** - * Gets a list of devices connected to Device Update for IoT Hub. + * Gets a list of all device groups. The $default group will always be returned first. * *

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).
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} @@ -1857,42 +3803,16 @@ public Mono> listDevicesSinglePageAsync(RequestOptions * *

{@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)
-     *                 }
-     *                 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)
-     *                     }
-     *                 ]
-     *             }
-     *         }
+     *     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)
      * }
      * }
* @@ -1901,29 +3821,29 @@ public Mono> listDevicesSinglePageAsync(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 devices connected to Device Update for IoT Hub as paginated response with {@link PagedFlux}. + * @return a list of all device groups as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDevicesAsync(RequestOptions requestOptions) { + public PagedFlux listGroupsAsync(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)); + () -> listGroupsSinglePageAsync(requestOptions), + nextLink -> listGroupsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of devices connected to Device Update for IoT Hub. + * Gets a list of all device groups. The $default group will always be returned first. * *

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).
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} @@ -1932,42 +3852,16 @@ public PagedFlux listDevicesAsync(RequestOptions requestOptions) { * *

{@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)
-     *                 }
-     *                 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)
-     *                     }
-     *                 ]
-     *             }
-     *         }
+     *     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)
      * }
      * }
* @@ -1976,165 +3870,254 @@ public PagedFlux listDevicesAsync(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 devices connected to Device Update for IoT Hub as paginated response with {@link - * PagedIterable}. + * @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 listDevices(RequestOptions requestOptions) { - return new PagedIterable<>(listDevicesAsync(requestOptions)); + 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)); } /** - * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header - * value to check for operation status. + * Gets the device group properties. * - *

Request Body Schema + *

Response Body Schema * *

{@code
-     * String(Devices/Modules/All)
+     * {
+     *     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 importType The types of devices to import. + * @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}. + * @return the device group properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> importDevicesWithResponseAsync(BinaryData importType, RequestOptions requestOptions) { + public Mono> getGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.importDevices( + service.getGroup( this.client.getEndpoint(), this.client.getInstanceId(), + groupId, 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. + * Gets the device group properties. * - *

Request Body Schema + *

Response Body Schema * *

{@code
-     * String(Devices/Modules/All)
+     * {
+     *     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 importType The types of devices to import. + * @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 PollerFlux} for polling of long-running operation. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @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)); + @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)); } /** - * 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)
-     * }
+ * 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 importType The types of devices to import. + * @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 SyncPoller} for polling of long-running operation. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginImportDevices(BinaryData importType, RequestOptions requestOptions) { - return this.beginImportDevicesAsync(importType, requestOptions).getSyncPoller(); + @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); } /** - * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. + * 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
      * {
-     *     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)
-     *             }
-     *         ]
-     *     }
+     *     totalDeviceCount: int (Required)
+     *     onLatestUpdateDeviceCount: int (Required)
+     *     newUpdatesAvailableDeviceCount: int (Required)
+     *     updatesInProgressDeviceCount: int (Required)
      * }
      * }
* - * @param deviceId Device identifier in Azure IoT Hub. + * @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 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 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> getDeviceWithResponseAsync(String deviceId, RequestOptions requestOptions) { + public Mono> getUpdateComplianceForGroupWithResponseAsync( + String groupId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getDevice( + service.getUpdateComplianceForGroup( this.client.getEndpoint(), this.client.getInstanceId(), - deviceId, + groupId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -2142,73 +4125,52 @@ public Mono> getDeviceWithResponseAsync(String deviceId, Re } /** - * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. + * 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
      * {
-     *     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)
-     *             }
-     *         ]
-     *     }
+     *     totalDeviceCount: int (Required)
+     *     onLatestUpdateDeviceCount: int (Required)
+     *     newUpdatesAvailableDeviceCount: int (Required)
+     *     updatesInProgressDeviceCount: int (Required)
      * }
      * }
* - * @param deviceId Device identifier in Azure IoT Hub. + * @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 properties and latest deployment status for a device connected to Device Update for IoT Hub - * 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 getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { - return getDeviceWithResponseAsync(deviceId, requestOptions).block(); + 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); } /** - * Gets the device module properties and latest deployment status for a device module connected to Device Update for - * IoT Hub. + * Get the best available updates for a device group and a count of how many devices need each update. * *

Response Body Schema * *

{@code
      * {
-     *     deviceId: String (Required)
-     *     moduleId: String (Optional)
+     *     groupId: String (Required)
      *     deviceClassId: String (Required)
-     *     groupId: String (Optional)
-     *     lastAttemptedUpdate (Optional): {
+     *     update (Required): {
      *         updateId (Required): {
      *             provider: String (Required)
      *             name: String (Required)
@@ -2217,186 +4179,191 @@ public Response getDeviceWithResponse(String deviceId, RequestOption
      *         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)
-     *             }
-     *         ]
-     *     }
+     *     deviceCount: int (Required)
      * }
      * }
* - * @param deviceId Device identifier in Azure IoT Hub. - * @param moduleId Device module identifier in Azure IoT Hub. + * @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 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 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) - public Mono> getDeviceModuleWithResponseAsync( - String deviceId, String moduleId, RequestOptions requestOptions) { + private Mono> listBestUpdatesForGroupSinglePageAsync( + String groupId, 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)); + 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)); } /** - * Gets the device module properties and latest deployment status for a device module connected to Device Update for - * IoT Hub. - * - *

Response Body Schema + * Get the best available updates for a device group and a count of how many devices need each update. * - *

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

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 deviceId Device identifier in Azure IoT Hub. - * @param moduleId Device module identifier in Azure IoT Hub. + * @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 module properties and latest deployment status for a device module connected to Device Update - * for IoT Hub along with {@link Response}. + * @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.SINGLE) - public Response getDeviceModuleWithResponse( - String deviceId, String moduleId, RequestOptions requestOptions) { - return getDeviceModuleWithResponseAsync(deviceId, moduleId, requestOptions).block(); + @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)); } /** - * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress - * receiving new updates. + * Get the best available updates for a device group and a count of how many devices need each update. * *

Response Body Schema * *

{@code
      * {
-     *     totalDeviceCount: int (Required)
-     *     onLatestUpdateDeviceCount: int (Required)
-     *     newUpdatesAvailableDeviceCount: int (Required)
-     *     updatesInProgressDeviceCount: int (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)
      * }
      * }
* + * @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 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 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) - public Mono> getUpdateComplianceWithResponseAsync(RequestOptions requestOptions) { + private PagedResponse listBestUpdatesForGroupSinglePage(String groupId, 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)); + 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); } /** - * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress - * receiving new updates. + * Get the best available updates for a device group and a count of how many devices need each update. * *

Response Body Schema * *

{@code
      * {
-     *     totalDeviceCount: int (Required)
-     *     onLatestUpdateDeviceCount: int (Required)
-     *     newUpdatesAvailableDeviceCount: int (Required)
-     *     updatesInProgressDeviceCount: int (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)
      * }
      * }
* + * @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 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 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.SINGLE) - public Response getUpdateComplianceWithResponse(RequestOptions requestOptions) { - return getUpdateComplianceWithResponseAsync(requestOptions).block(); + @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 all device groups. The $default group will always be returned first. + * Gets a list of deployments for a device group. * *

Query Parameters * * * * - * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
orderbyStringNoOrders the set of deployments returned. You can order by start date.
* * You can add these to a request with {@link RequestOptions#addQueryParam} @@ -2405,39 +4372,53 @@ public Response getUpdateComplianceWithResponse(RequestOptions reque * *

{@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)
-     *             ]
+     *     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)
      * }
      * }
* + * @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 all device groups along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return a list of deployments for a device group along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listGroupsSinglePageAsync(RequestOptions requestOptions) { + private Mono> listDeploymentsForGroupSinglePageAsync( + String groupId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listGroups( + service.listDeploymentsForGroup( this.client.getEndpoint(), this.client.getInstanceId(), + groupId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -2454,14 +4435,14 @@ public Mono> listGroupsSinglePageAsync(RequestOptions } /** - * Gets a list of all device groups. The $default group will always be returned first. + * Gets a list of deployments for a device group. * *

Query Parameters * * * * - * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
orderbyStringNoOrders the set of deployments returned. You can order by start date.
* * You can add these to a request with {@link RequestOptions#addQueryParam} @@ -2470,52 +4451,63 @@ public Mono> listGroupsSinglePageAsync(RequestOptions * *

{@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)
-     *             ]
+     *     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)
      * }
      * }
* + * @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 all device groups as paginated response with {@link PagedFlux}. + * @return a list of deployments for a device group as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listGroupsAsync(RequestOptions requestOptions) { + 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<>( - () -> listGroupsSinglePageAsync(requestOptions), - nextLink -> listGroupsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + () -> listDeploymentsForGroupSinglePageAsync(groupId, requestOptions), + nextLink -> listDeploymentsForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of all device groups. The $default group will always be returned first. + * Gets a list of deployments for a device group. * *

Query Parameters * * * * - * + * *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by groupId, deviceCount, createdDate, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
orderbyStringNoOrders the set of deployments returned. You can order by start date.
* * You can add these to a request with {@link RequestOptions#addQueryParam} @@ -2524,73 +4516,183 @@ public PagedFlux listGroupsAsync(RequestOptions requestOptions) { * *

{@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)
-     *             ]
+     *     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)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     }
+     *     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 all device groups as paginated response with {@link PagedIterable}. + * @return a list of deployments for a device group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGroups(RequestOptions requestOptions) { - return new PagedIterable<>(listGroupsAsync(requestOptions)); + 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 device group properties. + * 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)
-     *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
-     *     createdDateTime: String (Required)
-     *     deviceCount: Integer (Optional)
-     *     subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
-     *     subgroupsWithUpdatesInProgressCount: Integer (Optional)
-     *     subgroupsWithOnLatestUpdateCount: Integer (Optional)
-     *     deployments (Optional): [
+     *     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 device group properties along with {@link Response} on successful completion of {@link Mono}. + * @return the deployment properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { + public Mono> getDeploymentWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getGroup( + service.getDeployment( this.client.getEndpoint(), this.client.getInstanceId(), groupId, + deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -2598,123 +4700,275 @@ public Mono> getGroupWithResponseAsync(String groupId, Requ } /** - * Gets the device group properties. + * 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)
-     *     groupType: String(IoTHubTag/DefaultNoTag) (Required)
-     *     createdDateTime: String (Required)
-     *     deviceCount: Integer (Optional)
-     *     subgroupsWithNewUpdatesAvailableCount: Integer (Optional)
-     *     subgroupsWithUpdatesInProgressCount: Integer (Optional)
-     *     subgroupsWithOnLatestUpdateCount: Integer (Optional)
-     *     deployments (Optional): [
+     *     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 device group properties along with {@link Response}. + * @return the deployment properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getGroupWithResponse(String groupId, RequestOptions requestOptions) { - return getGroupWithResponseAsync(groupId, requestOptions).block(); + 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); } /** - * 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. + * 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 the {@link Response} on successful completion of {@link Mono}. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { + public Mono> createOrUpdateDeploymentWithResponseAsync( + String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.deleteGroup( + service.createOrUpdateDeployment( this.client.getEndpoint(), this.client.getInstanceId(), groupId, + deploymentId, this.client.getServiceVersion().getVersion(), + deployment, 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. + * 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 the {@link Response}. + * @return deployment metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { - return deleteGroupWithResponseAsync(groupId, requestOptions).block(); + 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); } /** - * 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)
-     * }
-     * }
+ * 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 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 the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getUpdateComplianceForGroupWithResponseAsync( - String groupId, RequestOptions requestOptions) { + public Mono> deleteDeploymentWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getUpdateComplianceForGroup( + service.deleteDeployment( this.client.getEndpoint(), this.client.getInstanceId(), groupId, + deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -2722,193 +4976,176 @@ public Mono> getUpdateComplianceForGroupWithResponseAsync( } /** - * 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)
-     * }
-     * }
+ * 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 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 the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getUpdateComplianceForGroupWithResponse(String groupId, RequestOptions requestOptions) { - return getUpdateComplianceForGroupWithResponseAsync(groupId, requestOptions).block(); + 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); } /** - * Get the best available updates for a device group and a count of how many devices need each update. + * 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
      * {
-     *     value (Required): [
+     *     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)
-     *             update (Required): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             deviceCount: int (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)
      *         }
      *     ]
-     *     nextLink: String (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 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 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> listBestUpdatesForGroupSinglePageAsync( - String groupId, RequestOptions requestOptions) { + public Mono> getDeploymentStatusWithResponseAsync( + String groupId, String deploymentId, 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)); + context -> + service.getDeploymentStatus( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); } /** - * Get the best available updates for a device group and a count of how many devices need each update. + * 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
      * {
-     *     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)
+     *     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)
      *         }
-     *     ]
-     *     nextLink: 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 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
-     * {
-     *     value (Required): [
+     *         occurredDateTime: OffsetDateTime (Optional)
+     *     }
+     *     subgroupStatus (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)
+     *             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)
      *         }
      *     ]
-     *     nextLink: String (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 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 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.COLLECTION) - public PagedIterable listBestUpdatesForGroup(String groupId, RequestOptions requestOptions) { - return new PagedIterable<>(listBestUpdatesForGroupAsync(groupId, requestOptions)); + @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); } /** - * Gets a list of deployments for a device group. + * 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
orderbyStringNoOrders the set of deployments returned. You can order by start date.
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} @@ -2917,36 +5154,11 @@ public PagedIterable listBestUpdatesForGroup(String groupId, Request * *

{@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)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
      * }
      * }
* @@ -2956,16 +5168,16 @@ public PagedIterable listBestUpdatesForGroup(String groupId, 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 deployments for a device group along with {@link PagedResponse} on successful completion of + * @return the device class subgroups for the group along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeploymentsForGroupSinglePageAsync( + private Mono> listDeviceClassSubgroupsForGroupSinglePageAsync( String groupId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listDeploymentsForGroup( + service.listDeviceClassSubgroupsForGroup( this.client.getEndpoint(), this.client.getInstanceId(), groupId, @@ -2985,14 +5197,61 @@ public Mono> listDeploymentsForGroupSinglePageAsync( } /** - * Gets a list of deployments for a device group. + * 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
orderbyStringNoOrders the set of deployments returned. You can order by start date.
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} @@ -3001,36 +5260,11 @@ public Mono> listDeploymentsForGroupSinglePageAsync( * *

{@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)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
      * }
      * }
* @@ -3040,29 +5274,40 @@ public Mono> listDeploymentsForGroupSinglePageAsync( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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}. + * @return the device class subgroups for the group along with {@link PagedResponse}. */ - @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)); + @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); } /** - * Gets a list of deployments for a device group. + * 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
orderbyStringNoOrders the set of deployments returned. You can order by start date.
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} @@ -3071,36 +5316,11 @@ public PagedFlux listDeploymentsForGroupAsync(String groupId, Reques * *

{@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)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
      * }
      * }
* @@ -3110,68 +5330,56 @@ public PagedFlux listDeploymentsForGroupAsync(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 a list of deployments for a device group as paginated response with {@link PagedIterable}. + * @return the device class subgroups for the group as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { - return new PagedIterable<>(listDeploymentsForGroupAsync(groupId, requestOptions)); + 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 the deployment properties. + * 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
      * {
-     *     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)
-     *     }
+     *     deviceClassId: String (Required)
      *     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)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
      * }
      * }
* * @param groupId Group identifier. - * @param deploymentId Deployment 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 deployment properties along with {@link Response} on successful completion of {@link Mono}. + * @return device class subgroup details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeploymentWithResponseAsync( - String groupId, String deploymentId, RequestOptions requestOptions) { + public Mono> getDeviceClassSubgroupWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getDeployment( + service.getDeviceClassSubgroup( this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deploymentId, + deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -3179,191 +5387,202 @@ public Mono> getDeploymentWithResponseAsync( } /** - * Gets the deployment properties. + * 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
      * {
-     *     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)
-     *     }
+     *     deviceClassId: String (Required)
      *     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)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
      * }
      * }
* * @param groupId Group identifier. - * @param deploymentId Deployment 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 deployment properties along with {@link Response}. + * @return device class subgroup details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeploymentWithResponse( - String groupId, String deploymentId, RequestOptions requestOptions) { - return getDeploymentWithResponseAsync(groupId, deploymentId, requestOptions).block(); + 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); } /** - * Creates or updates a deployment. + * 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. * - *

Request Body Schema + * @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. * - *

{@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 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
-     * {
-     *     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)
+     * 
{@code
+     * {
+     *     totalDeviceCount: int (Required)
+     *     onLatestUpdateDeviceCount: int (Required)
+     *     newUpdatesAvailableDeviceCount: int (Required)
+     *     updatesInProgressDeviceCount: int (Required)
      * }
      * }
* * @param groupId Group identifier. - * @param deploymentId Deployment identifier. - * @param deployment The deployment properties. + * @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 deployment metadata 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> createOrUpdateDeploymentWithResponseAsync( - String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { + public Mono> getDeviceClassSubgroupUpdateComplianceWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.createOrUpdateDeployment( + service.getDeviceClassSubgroupUpdateCompliance( this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deploymentId, + deviceClassId, this.client.getServiceVersion().getVersion(), - deployment, accept, requestOptions, context)); } /** - * Creates or updates a deployment. + * 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. * - *

Request Body Schema + *

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)
+     *     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
      * {
-     *     deploymentId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
+     *     groupId: String (Required)
+     *     deviceClassId: String (Required)
      *     update (Required): {
      *         updateId (Required): {
      *             provider: String (Required)
@@ -3373,62 +5592,31 @@ public Mono> createOrUpdateDeploymentWithResponseAsync(
      *         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)
+     *     deviceCount: int (Required)
      * }
      * }
* * @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) { - return createOrUpdateDeploymentWithResponseAsync(groupId, deploymentId, deployment, requestOptions).block(); - } - - /** - * Deletes a deployment. - * - * @param groupId Group identifier. - * @param deploymentId Deployment 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}. + * @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> deleteDeploymentWithResponseAsync( - String groupId, String deploymentId, RequestOptions requestOptions) { + public Mono> getBestUpdatesForDeviceClassSubgroupWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.deleteDeployment( + service.getBestUpdatesForDeviceClassSubgroup( this.client.getEndpoint(), this.client.getInstanceId(), groupId, - deploymentId, + deviceClassId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -3436,158 +5624,210 @@ public Mono> deleteDeploymentWithResponseAsync( } /** - * Deletes a deployment. + * 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 deploymentId Deployment 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}. + * @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 deleteDeploymentWithResponse( - String groupId, String deploymentId, RequestOptions requestOptions) { - return deleteDeploymentWithResponseAsync(groupId, deploymentId, requestOptions).block(); + 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 the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. + * 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
      * {
-     *     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)
+     *     deploymentId: String (Required)
+     *     startDateTime: OffsetDateTime (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *         occurredDateTime: OffsetDateTime (Optional)
+     *         description: String (Optional)
+     *         friendlyName: String (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)
-     *         }
+     *     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 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 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 a list of deployments for a device class subgroup along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeploymentStatusWithResponseAsync( - String groupId, String deploymentId, RequestOptions requestOptions) { + private Mono> listDeploymentsForDeviceClassSubgroupSinglePageAsync( + String groupId, String deviceClassId, 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)); + 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 the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. + * 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
      * {
-     *     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)
+     *     deploymentId: String (Required)
+     *     startDateTime: OffsetDateTime (Required)
+     *     update (Required): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *         occurredDateTime: OffsetDateTime (Optional)
+     *         description: String (Optional)
+     *         friendlyName: String (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)
-     *         }
+     *     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 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 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 a list of deployments for a device class subgroup as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeploymentStatusWithResponse( - String groupId, String deploymentId, RequestOptions requestOptions) { - return getDeploymentStatusWithResponseAsync(groupId, deploymentId, requestOptions).block(); + @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)); } /** - * 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. + * Gets a list of deployments for a device class subgroup. * *

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')
orderbyStringNoOrders the set of deployments returned. You can order by start date.
* * You can add these to a request with {@link RequestOptions#addQueryParam} @@ -3596,63 +5836,75 @@ public Response getDeploymentStatusWithResponse( * *

{@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             groupId: String (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             deploymentId: String (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)
      * }
      * }
* * @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 device class subgroups for the group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of deployments for a device class subgroup along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeviceClassSubgroupsForGroupSinglePageAsync( - String groupId, RequestOptions requestOptions) { + private PagedResponse listDeploymentsForDeviceClassSubgroupSinglePage( + String groupId, String deviceClassId, 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)); + 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); } /** - * 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. + * Gets a list of deployments for a device class subgroup. * *

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')
orderbyStringNoOrders the set of deployments returned. You can order by start date.
* * You can add these to a request with {@link RequestOptions#addQueryParam} @@ -3661,119 +5913,205 @@ public Mono> listDeviceClassSubgroupsForGroupSinglePag * *

{@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             groupId: String (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             deploymentId: String (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)
      * }
      * }
* * @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 device class subgroups for the group as paginated response with {@link PagedFlux}. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeviceClassSubgroupsForGroupAsync(String groupId, RequestOptions requestOptions) { + 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 PagedFlux<>( - () -> listDeviceClassSubgroupsForGroupSinglePageAsync(groupId, requestOptions), - nextLink -> listDeviceClassSubgroupsForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + return new PagedIterable<>( + () -> listDeploymentsForDeviceClassSubgroupSinglePage(groupId, deviceClassId, requestOptions), + nextLink -> listDeploymentsForDeviceClassSubgroupNextSinglePage(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. + * Gets the deployment properties. * - *

Query Parameters + *

Response Body Schema * - * - * - * - * - *
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')
+ *

{@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)
+     * }
+     * }
* - * You can add these to a request with {@link RequestOptions#addQueryParam} + * @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
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             groupId: String (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             deploymentId: String (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)
      * }
      * }
* * @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 device class subgroups for the group as paginated response with {@link PagedIterable}. + * @return the deployment properties along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceClassSubgroupsForGroup(String groupId, RequestOptions requestOptions) { - return new PagedIterable<>(listDeviceClassSubgroupsForGroupAsync(groupId, requestOptions)); + @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); } /** - * 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)
-     * }
-     * }
+ * 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 device class subgroup details along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeviceClassSubgroupWithResponseAsync( - String groupId, String deviceClassId, RequestOptions requestOptions) { + public Mono> deleteDeploymentForDeviceClassSubgroupWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getDeviceClassSubgroup( + service.deleteDeploymentForDeviceClassSubgroup( this.client.getEndpoint(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -3781,63 +6119,91 @@ public Mono> getDeviceClassSubgroupWithResponseAsync( } /** - * 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)
-     * }
-     * }
+ * 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 device class subgroup details along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeviceClassSubgroupWithResponse( - String groupId, String deviceClassId, RequestOptions requestOptions) { - return getDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + 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); } /** - * 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. + * 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 the {@link Response} on successful completion of {@link Mono}. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeviceClassSubgroupWithResponseAsync( - String groupId, String deviceClassId, RequestOptions requestOptions) { + public Mono> stopDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.deleteDeviceClassSubgroup( + service.stopDeployment( this.client.getEndpoint(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -3845,64 +6211,123 @@ public Mono> deleteDeviceClassSubgroupWithResponseAsync( } /** - * 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. + * 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 the {@link Response}. + * @return deployment metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeviceClassSubgroupWithResponse( - String groupId, String deviceClassId, RequestOptions requestOptions) { - return deleteDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + 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); } /** - * 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. + * Retries a deployment with failed devices. * *

Response Body Schema * *

{@code
      * {
-     *     totalDeviceCount: int (Required)
-     *     onLatestUpdateDeviceCount: int (Required)
-     *     newUpdatesAvailableDeviceCount: int (Required)
-     *     updatesInProgressDeviceCount: int (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)
      * }
      * }
* * @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 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 deployment metadata along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDeviceClassSubgroupUpdateComplianceWithResponseAsync( - String groupId, String deviceClassId, RequestOptions requestOptions) { + public Mono> retryDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getDeviceClassSubgroupUpdateCompliance( + service.retryDeployment( this.client.getEndpoint(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -3910,39 +6335,69 @@ public Mono> getDeviceClassSubgroupUpdateComplianceWithResp } /** - * 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. + * Retries a deployment with failed devices. * *

Response Body Schema * *

{@code
      * {
-     *     totalDeviceCount: int (Required)
-     *     onLatestUpdateDeviceCount: int (Required)
-     *     newUpdatesAvailableDeviceCount: int (Required)
-     *     updatesInProgressDeviceCount: int (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)
      * }
      * }
* * @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 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 deployment metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeviceClassSubgroupUpdateComplianceWithResponse( - String groupId, String deviceClassId, RequestOptions requestOptions) { - return getDeviceClassSubgroupUpdateComplianceWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + 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); } /** - * Get the best available update for a device class subgroup and a count of how many devices need this update. + * 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 * @@ -3950,40 +6405,53 @@ public Response getDeviceClassSubgroupUpdateComplianceWithResponse( * { * groupId: String (Required) * deviceClassId: String (Required) - * update (Required): { - * updateId (Required): { - * provider: String (Required) - * name: String (Required) - * version: 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) * } - * description: String (Optional) - * friendlyName: String (Optional) + * occurredDateTime: OffsetDateTime (Optional) * } - * deviceCount: int (Required) + * 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 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 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> getBestUpdatesForDeviceClassSubgroupWithResponseAsync( - String groupId, String deviceClassId, RequestOptions requestOptions) { + public Mono> getDeviceClassSubgroupDeploymentStatusWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getBestUpdatesForDeviceClassSubgroup( + service.getDeviceClassSubgroupDeploymentStatus( this.client.getEndpoint(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -3991,7 +6459,8 @@ public Mono> getBestUpdatesForDeviceClassSubgroupWithRespon } /** - * Get the best available update for a device class subgroup and a count of how many devices need this update. + * 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 * @@ -3999,44 +6468,66 @@ public Mono> getBestUpdatesForDeviceClassSubgroupWithRespon * { * groupId: String (Required) * deviceClassId: String (Required) - * update (Required): { - * updateId (Required): { - * provider: String (Required) - * name: String (Required) - * version: 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) * } - * description: String (Optional) - * friendlyName: String (Optional) + * occurredDateTime: OffsetDateTime (Optional) * } - * deviceCount: int (Required) + * 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 best available update for a device class subgroup and a count of how many devices need this update - * 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 getBestUpdatesForDeviceClassSubgroupWithResponse( - String groupId, String deviceClassId, RequestOptions requestOptions) { - return getBestUpdatesForDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + 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 deployments for a device class subgroup. + * 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
orderbyStringNoOrders the set of deployments returned. You can order by start date.
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} @@ -4045,60 +6536,37 @@ public Response getBestUpdatesForDeviceClassSubgroupWithResponse( * *

{@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)
-     *         }
-     *     ]
-     *     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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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 + * @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) - public Mono> listDeploymentsForDeviceClassSubgroupSinglePageAsync( - String groupId, String deviceClassId, RequestOptions requestOptions) { + private Mono> listDeviceStatesForDeviceClassSubgroupDeploymentSinglePageAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listDeploymentsForDeviceClassSubgroup( + service.listDeviceStatesForDeviceClassSubgroupDeployment( this.client.getEndpoint(), this.client.getInstanceId(), groupId, deviceClassId, + deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -4115,14 +6583,14 @@ public Mono> listDeploymentsForDeviceClassSubgroupSing } /** - * Gets a list of deployments for a device class subgroup. + * 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
orderbyStringNoOrders the set of deployments returned. You can order by start date.
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} @@ -4131,71 +6599,50 @@ public Mono> listDeploymentsForDeviceClassSubgroupSing * *

{@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)
-     *         }
-     *     ]
-     *     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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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}. + * @return a list of devices in a deployment along with their state as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeploymentsForDeviceClassSubgroupAsync( - String groupId, String deviceClassId, RequestOptions requestOptions) { + 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<>( - () -> listDeploymentsForDeviceClassSubgroupSinglePageAsync(groupId, deviceClassId, requestOptions), + () -> + listDeviceStatesForDeviceClassSubgroupDeploymentSinglePageAsync( + groupId, deviceClassId, deploymentId, requestOptions), nextLink -> - listDeploymentsForDeviceClassSubgroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePageAsync( + nextLink, requestOptionsForNextPage)); } /** - * Gets a list of deployments for a device class subgroup. + * 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
orderbyStringNoOrders the set of deployments returned. You can order by start date.
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} @@ -4204,86 +6651,70 @@ public PagedFlux listDeploymentsForDeviceClassSubgroupAsync( * *

{@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)
-     *         }
-     *     ]
-     *     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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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}. + * @return a list of devices in a deployment along with their state along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeploymentsForDeviceClassSubgroup( - String groupId, String deviceClassId, RequestOptions requestOptions) { - return new PagedIterable<>(listDeploymentsForDeviceClassSubgroupAsync(groupId, deviceClassId, requestOptions)); + @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 the deployment properties. + * 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
      * {
-     *     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)
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     retryCount: int (Required)
+     *     movedOnToNewDeployment: boolean (Required)
+     *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
      * }
* @@ -4295,20 +6726,85 @@ public PagedIterable listDeploymentsForDeviceClassSubgroup( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request 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}. + * @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> getDeploymentForDeviceClassSubgroupWithResponseAsync( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + public Mono> getOperationStatusWithResponseAsync( + String operationId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getDeploymentForDeviceClassSubgroup( + service.getOperationStatus( this.client.getEndpoint(), this.client.getInstanceId(), - groupId, - deviceClassId, - deploymentId, + operationId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -4316,395 +6812,499 @@ public Mono> getDeploymentForDeviceClassSubgroupWithRespons } /** - * Gets the deployment properties. + * 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
      * {
-     *     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)
+     *     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)
      *     }
-     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     traceId: String (Optional)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
      * }
      * }
* - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. + * @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 the deployment properties along with {@link Response}. + * @return operation metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeploymentForDeviceClassSubgroupWithResponse( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return getDeploymentForDeviceClassSubgroupWithResponseAsync( - groupId, deviceClassId, deploymentId, requestOptions) - .block(); + 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); } /** - * Deletes a device class subgroup deployment. + * 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 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}. + * @return a list of all device import operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteDeploymentForDeviceClassSubgroupWithResponseAsync( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + private Mono> listOperationStatusesSinglePageAsync(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)); + 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)); } /** - * Deletes a device class subgroup deployment. + * 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 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}. + * @return a list of all device import operations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteDeploymentForDeviceClassSubgroupWithResponse( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return deleteDeploymentForDeviceClassSubgroupWithResponseAsync( - groupId, deviceClassId, deploymentId, requestOptions) - .block(); + @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)); } /** - * Stops a deployment. + * 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
      * {
-     *     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)
+     *     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)
      *     }
-     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     traceId: String (Optional)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (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}. + * @return a list of all device import operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> stopDeploymentWithResponseAsync( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + private PagedResponse listOperationStatusesSinglePage(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)); + 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); } /** - * Stops a deployment. + * 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
      * {
-     *     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)
+     *     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)
      *     }
-     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     traceId: String (Optional)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (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}. + * @return a list of all device import operations as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response stopDeploymentWithResponse( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return stopDeploymentWithResponseAsync(groupId, deviceClassId, deploymentId, requestOptions).block(); + @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)); } /** - * Retries a deployment with failed devices. + * Start the device diagnostics log collection on specified devices. * - *

Response Body Schema + *

Request Body Schema * *

{@code
      * {
-     *     deploymentId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
+     *          (Required){
+     *             deviceId: String (Required)
+     *             moduleId: String (Optional)
      *         }
-     *         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)
+     *     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)
      *         }
-     *     }
-     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     ]
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
      * }
* - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. + * @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 deployment metadata along with {@link Response} on successful completion of {@link Mono}. + * @return diagnostics request body 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) { + public Mono> startLogCollectionWithResponseAsync( + String logCollectionId, BinaryData logCollection, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.retryDeployment( + service.startLogCollection( this.client.getEndpoint(), this.client.getInstanceId(), - groupId, - deviceClassId, - deploymentId, + logCollectionId, this.client.getServiceVersion().getVersion(), + logCollection, accept, requestOptions, context)); } /** - * Retries a deployment with failed devices. + * Start the device diagnostics log collection on specified devices. * - *

Response Body Schema + *

Request Body Schema * *

{@code
      * {
-     *     deploymentId: String (Required)
-     *     startDateTime: OffsetDateTime (Required)
-     *     update (Required): {
-     *         updateId (Required): {
-     *             provider: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
+     *          (Required){
+     *             deviceId: String (Required)
+     *             moduleId: String (Optional)
      *         }
-     *         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)
+     *     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)
      *         }
-     *     }
-     *     isCloudInitiatedRollback: Boolean (Optional)
+     *     ]
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
      * }
* - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. + * @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 deployment metadata along with {@link Response}. + * @return diagnostics request body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response retryDeploymentWithResponse( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return retryDeploymentWithResponseAsync(groupId, deviceClassId, deploymentId, requestOptions).block(); + 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); } /** - * 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 + * Get the device diagnostics log collection. * - *

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

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
+     *          (Required){
+     *             deviceId: String (Required)
+     *             moduleId: String (Optional)
      *         }
-     *         occurredDateTime: OffsetDateTime (Optional)
-     *     }
-     *     totalDevices: Integer (Optional)
-     *     devicesInProgressCount: Integer (Optional)
-     *     devicesCompletedFailedCount: Integer (Optional)
-     *     devicesCompletedSucceededCount: Integer (Optional)
-     *     devicesCanceledCount: Integer (Optional)
+     *     ]
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
      * }
* - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. + * @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 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 device diagnostics log collection 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) { + public Mono> getLogCollectionWithResponseAsync( + String logCollectionId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getDeviceClassSubgroupDeploymentStatus( + service.getLogCollection( this.client.getEndpoint(), this.client.getInstanceId(), - groupId, - deviceClassId, - deploymentId, + logCollectionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -4712,111 +7312,84 @@ public Mono> getDeviceClassSubgroupDeploymentStatusWithResp } /** - * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, - * completed, or failed. + * Get the device diagnostics log collection. * *

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)
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
+     *          (Required){
+     *             deviceId: String (Required)
+     *             moduleId: String (Optional)
      *         }
-     *         occurredDateTime: OffsetDateTime (Optional)
-     *     }
-     *     totalDevices: Integer (Optional)
-     *     devicesInProgressCount: Integer (Optional)
-     *     devicesCompletedFailedCount: Integer (Optional)
-     *     devicesCompletedSucceededCount: Integer (Optional)
-     *     devicesCanceledCount: Integer (Optional)
+     *     ]
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
      * }
* - * @param groupId Group identifier. - * @param deviceClassId Device class identifier. - * @param deploymentId Deployment identifier. + * @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 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 device diagnostics log collection along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDeviceClassSubgroupDeploymentStatusWithResponse( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { - return getDeviceClassSubgroupDeploymentStatusWithResponseAsync( - groupId, deviceClassId, deploymentId, requestOptions) - .block(); + 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); } /** - * 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} + * Get all device diagnostics log collections. * *

Response Body Schema * *

{@code
      * {
-     *     value (Required): [
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
      *          (Required){
      *             deviceId: String (Required)
      *             moduleId: String (Optional)
-     *             retryCount: int (Required)
-     *             movedOnToNewDeployment: boolean (Required)
-     *             deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      *         }
      *     ]
-     *     nextLink: String (Optional)
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (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 a list of devices in a deployment along with their state along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all device diagnostics log collections along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeviceStatesForDeviceClassSubgroupDeploymentSinglePageAsync( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + private Mono> listLogCollectionsSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listDeviceStatesForDeviceClassSubgroupDeployment( + service.listLogCollections( this.client.getEndpoint(), this.client.getInstanceId(), - groupId, - deviceClassId, - deploymentId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -4833,170 +7406,176 @@ public Mono> listDeviceStatesForDeviceClassSubgroupDep } /** - * 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} + * Get all device diagnostics log collections. * *

Response Body Schema * *

{@code
      * {
-     *     value (Required): [
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
      *          (Required){
      *             deviceId: String (Required)
      *             moduleId: String (Optional)
-     *             retryCount: int (Required)
-     *             movedOnToNewDeployment: boolean (Required)
-     *             deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      *         }
      *     ]
-     *     nextLink: String (Optional)
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (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 a list of devices in a deployment along with their state as paginated response with {@link PagedFlux}. + * @return all device diagnostics log collections as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listDeviceStatesForDeviceClassSubgroupDeploymentAsync( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + public PagedFlux listLogCollectionsAsync(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)); + () -> listLogCollectionsSinglePageAsync(requestOptions), + nextLink -> listLogCollectionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. + * Get all device diagnostics log collections. * - *

Query Parameters + *

Response Body Schema * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.
+ *

{@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)
+     * }
+     * }
* - * You can add these to a request with {@link RequestOptions#addQueryParam} + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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
      * {
-     *     value (Required): [
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
      *          (Required){
      *             deviceId: String (Required)
      *             moduleId: String (Optional)
-     *             retryCount: int (Required)
-     *             movedOnToNewDeployment: boolean (Required)
-     *             deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      *         }
      *     ]
-     *     nextLink: String (Optional)
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (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 a list of devices in a deployment along with their state as paginated response with {@link - * PagedIterable}. + * @return all device diagnostics log collections as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceStatesForDeviceClassSubgroupDeployment( - String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + public PagedIterable listLogCollections(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); return new PagedIterable<>( - listDeviceStatesForDeviceClassSubgroupDeploymentAsync( - groupId, deviceClassId, deploymentId, requestOptions)); + () -> listLogCollectionsSinglePage(requestOptions), + nextLink -> listLogCollectionsNextSinglePage(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} + * Get log collection with detailed status. * *

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)
+     *     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)
      *         }
-     *         occurredDateTime: OffsetDateTime (Optional)
-     *     }
-     *     traceId: String (Optional)
-     *     lastActionDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
+     *     ]
+     *     description: String (Optional)
      * }
      * }
* - * @param operationId Operation identifier. + * @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 operation metadata along with {@link Response} on successful completion of {@link Mono}. + * @return log collection with detailed status along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOperationStatusWithResponseAsync( - String operationId, RequestOptions requestOptions) { + public Mono> getLogCollectionDetailedStatusWithResponseAsync( + String logCollectionId, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getOperationStatus( + service.getLogCollectionDetailedStatus( this.client.getEndpoint(), this.client.getInstanceId(), - operationId, + logCollectionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, @@ -5004,123 +7583,92 @@ public Mono> getOperationStatusWithResponseAsync( } /** - * 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} + * Get log collection with detailed status. * *

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)
+     *     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)
      *         }
-     *         occurredDateTime: OffsetDateTime (Optional)
-     *     }
-     *     traceId: String (Optional)
-     *     lastActionDateTime: OffsetDateTime (Required)
-     *     createdDateTime: OffsetDateTime (Required)
-     *     etag: String (Optional)
+     *     ]
+     *     description: String (Optional)
      * }
      * }
* - * @param operationId Operation identifier. + * @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 operation metadata along with {@link Response}. + * @return log collection with detailed status along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { - return getOperationStatusWithResponseAsync(operationId, requestOptions).block(); + 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 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} + * Get list of device health. * *

Response Body Schema * *

{@code
      * {
-     *     value (Required): [
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     state: String(healthy/unhealthy) (Required)
+     *     digitalTwinModelId: String (Optional)
+     *     healthChecks (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)
+     *             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 requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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}. + * @return list of device health along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOperationStatusesSinglePageAsync(RequestOptions requestOptions) { + private Mono> listHealthOfDevicesSinglePageAsync( + String filter, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listOperationStatuses( + service.listHealthOfDevices( this.client.getEndpoint(), this.client.getInstanceId(), this.client.getServiceVersion().getVersion(), + filter, accept, requestOptions, context)) @@ -5136,375 +7684,394 @@ public Mono> listOperationStatusesSinglePageAsync(Requ } /** - * 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} + * Get list of device health. * *

Response Body Schema * *

{@code
      * {
-     *     value (Required): [
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     state: String(healthy/unhealthy) (Required)
+     *     digitalTwinModelId: String (Optional)
+     *     healthChecks (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)
+     *             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 requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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}. + * @return list of device health as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listOperationStatusesAsync(RequestOptions requestOptions) { + 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<>( - () -> listOperationStatusesSinglePageAsync(requestOptions), - nextLink -> listOperationStatusesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + () -> listHealthOfDevicesSinglePageAsync(filter, requestOptions), + nextLink -> listHealthOfDevicesNextSinglePageAsync(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} + * Get list of device health. * *

Response Body Schema * *

{@code
      * {
-     *     value (Required): [
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     state: String(healthy/unhealthy) (Required)
+     *     digitalTwinModelId: String (Optional)
+     *     healthChecks (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)
+     *             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 requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the 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}. + * @return list of device health along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - return new PagedIterable<>(listOperationStatusesAsync(requestOptions)); + @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); } /** - * 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)
-     * }
-     * }
+ * Get list of device health. * *

Response Body Schema * *

{@code
      * {
-     *     operationId: String (Optional)
-     *     deviceList (Required): [
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     state: String(healthy/unhealthy) (Required)
+     *     digitalTwinModelId: String (Optional)
+     *     healthChecks (Required): [
      *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
+     *             name: String (Optional)
+     *             result: String(success/userError) (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 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 diagnostics request body along with {@link Response} on successful completion of {@link Mono}. + * @return list of device health as paginated response with {@link PagedIterable}. */ - @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)); + @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)); } /** - * Start the device diagnostics log collection on specified devices. + * Get the next page of items. * - *

Request Body Schema + *

Response Body Schema * *

{@code
      * {
-     *     operationId: String (Optional)
-     *     deviceList (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
+     *     deviceClassId: String (Required)
+     *     friendlyName: String (Optional)
+     *     deviceClassProperties (Required): {
+     *         contractModel (Optional): {
+     *             id: String (Required)
+     *             name: String (Required)
      *         }
-     *     ]
-     *     description: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (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 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
      * {
-     *     operationId: String (Optional)
-     *     deviceList (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
+     *     deviceClassId: String (Required)
+     *     friendlyName: String (Optional)
+     *     deviceClassProperties (Required): {
+     *         contractModel (Optional): {
+     *             id: String (Required)
+     *             name: String (Required)
      *         }
-     *     ]
-     *     description: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (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 logCollectionId Log collection identifier. - * @param logCollection The log collection properties. + * @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 diagnostics request body along with {@link Response}. + * @return the list of device classes along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response startLogCollectionWithResponse( - String logCollectionId, BinaryData logCollection, RequestOptions requestOptions) { - return startLogCollectionWithResponseAsync(logCollectionId, logCollection, requestOptions).block(); + 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 device diagnostics log collection. + * Get the next page of items. * *

Response Body Schema * *

{@code
      * {
-     *     operationId: String (Optional)
-     *     deviceList (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *         }
-     *     ]
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
      *     description: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
+     *     friendlyName: String (Optional)
      * }
      * }
* - * @param logCollectionId Log collection identifier. + * @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 device diagnostics log collection along with {@link Response} on successful completion of {@link - * Mono}. + * @return list of update information along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLogCollectionWithResponseAsync( - String logCollectionId, RequestOptions requestOptions) { + private Mono> listInstallableUpdatesForDeviceClassNextSinglePageAsync( + String nextLink, 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)); + 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 device diagnostics log collection. + * Get the next page of items. * *

Response Body Schema * *

{@code
      * {
-     *     operationId: String (Optional)
-     *     deviceList (Required): [
-     *          (Required){
-     *             deviceId: String (Required)
-     *             moduleId: String (Optional)
-     *         }
-     *     ]
+     *     updateId (Required): {
+     *         provider: String (Required)
+     *         name: String (Required)
+     *         version: String (Required)
+     *     }
      *     description: String (Optional)
-     *     createdDateTime: String (Optional)
-     *     lastActionDateTime: String (Optional)
-     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
+     *     friendlyName: String (Optional)
      * }
      * }
* - * @param logCollectionId Log collection identifier. + * @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 device diagnostics log collection along with {@link Response}. + * @return list of update information along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLogCollectionWithResponse(String logCollectionId, RequestOptions requestOptions) { - return getLogCollectionWithResponseAsync(logCollectionId, requestOptions).block(); + 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 all device diagnostics log collections. + * Get the next page of items. * *

Response Body Schema * *

{@code
      * {
-     *     value (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)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Optional)
+     *     lastAttemptedUpdate (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         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 all device diagnostics log collections along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list of devices along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listLogCollectionsSinglePageAsync(RequestOptions requestOptions) { + private Mono> listDevicesNextSinglePageAsync( + String nextLink, 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)) + service.listDevicesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> new PagedResponseBase<>( @@ -5517,224 +8084,200 @@ public Mono> listLogCollectionsSinglePageAsync(Request } /** - * Get all device diagnostics log collections. - * - *

Response Body Schema - * - *

{@code
-     * {
-     *     value (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)
-     *         }
-     *     ]
-     *     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 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. + * Get the next page of items. * *

Response Body Schema * *

{@code
      * {
-     *     value (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)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Optional)
+     *     lastAttemptedUpdate (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         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 all device diagnostics log collections as paginated response with {@link PagedIterable}. + * @return the list of devices along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLogCollections(RequestOptions requestOptions) { - return new PagedIterable<>(listLogCollectionsAsync(requestOptions)); + @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 log collection with detailed status. + * Get the next page of items. * *

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)
-     *         }
+     *     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)
      *     ]
-     *     description: String (Optional)
      * }
      * }
* - * @param logCollectionId Log collection identifier. + * @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 log collection with detailed status along with {@link Response} on successful completion of {@link Mono}. + * @return the list of groups along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLogCollectionDetailedStatusWithResponseAsync( - String logCollectionId, RequestOptions requestOptions) { + private Mono> listGroupsNextSinglePageAsync( + String nextLink, 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.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 log collection with detailed status. + * Get the next page of items. * *

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)
-     *         }
+     *     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)
      *     ]
-     *     description: String (Optional)
      * }
      * }
* - * @param logCollectionId Log collection identifier. + * @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 log collection with detailed status along with {@link Response}. + * @return the list of groups along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLogCollectionDetailedStatusWithResponse( - String logCollectionId, RequestOptions requestOptions) { - return getLogCollectionDetailedStatusWithResponseAsync(logCollectionId, requestOptions).block(); + 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 list of device health. + * Get the next page of items. * *

Response Body Schema * *

{@code
      * {
-     *     value (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)
-     *                 }
-     *             ]
+     *     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 filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * @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 device health along with {@link PagedResponse} on successful completion of {@link Mono}. + * @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) - public Mono> listHealthOfDevicesSinglePageAsync( - String filter, RequestOptions requestOptions) { + private Mono> listBestUpdatesForGroupNextSinglePageAsync( + String nextLink, 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)) + service.listBestUpdatesForGroupNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> new PagedResponseBase<>( @@ -5747,88 +8290,113 @@ public Mono> listHealthOfDevicesSinglePageAsync( } /** - * Get list of device health. + * Get the next page of items. * *

Response Body Schema * *

{@code
      * {
-     *     value (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)
-     *                 }
-     *             ]
+     *     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 filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * @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 device health as paginated response with {@link PagedFlux}. + * @return the list of updatable devices for a device class subgroup along with {@link PagedResponse}. */ - @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)); + @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 list of device health. + * Get the next page of items. * *

Response Body Schema * *

{@code
      * {
-     *     value (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)
-     *                 }
-     *             ]
+     *     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)
      * }
      * }
* - * @param filter Restricts the set of devices for which device health is returned. You can filter on status, device - * id and module id. + * @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 device health as paginated response with {@link PagedIterable}. + * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listHealthOfDevices(String filter, RequestOptions requestOptions) { - return new PagedIterable<>(listHealthOfDevicesAsync(filter, requestOptions)); + @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)); } /** @@ -5838,31 +8406,31 @@ public PagedIterable listHealthOfDevices(String filter, RequestOptio * *

{@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)
-     *             }
+     *     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)
      * }
      * }
* @@ -5873,25 +8441,22 @@ 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 the list of device classes along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of deployments along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeviceClassesNextSinglePageAsync( + private PagedResponse listDeploymentsForGroupNextSinglePage( 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)); + 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); } /** @@ -5901,18 +8466,11 @@ public Mono> listDeviceClassesNextSinglePageAsync( * *
{@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             updateId (Required): {
-     *                 provider: String (Required)
-     *                 name: String (Required)
-     *                 version: String (Required)
-     *             }
-     *             description: String (Optional)
-     *             friendlyName: String (Optional)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceClassId: String (Required)
+     *     groupId: String (Required)
+     *     createdDateTime: String (Required)
+     *     deviceCount: Integer (Optional)
+     *     deploymentId: String (Optional)
      * }
      * }
* @@ -5923,15 +8481,16 @@ public Mono> listDeviceClassesNextSinglePageAsync( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return list of update information along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of device class subgroups within a group along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listInstallableUpdatesForDeviceClassNextSinglePageAsync( + private Mono> listDeviceClassSubgroupsForGroupNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listInstallableUpdatesForDeviceClassNext( + service.listDeviceClassSubgroupsForGroupNext( nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> @@ -5951,42 +8510,71 @@ public Mono> listInstallableUpdatesForDeviceClassNextS * *
{@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)
-     *                 }
-     *                 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)
-     *                     }
-     *                 ]
-     *             }
+     *     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)
      *     ]
-     *     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)
      * }
      * }
* @@ -5997,15 +8585,15 @@ public Mono> listInstallableUpdatesForDeviceClassNextS * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of devices along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDevicesNextSinglePageAsync( + private Mono> listDeploymentsForDeviceClassSubgroupNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listDevicesNext( + service.listDeploymentsForDeviceClassSubgroupNext( nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> @@ -6025,21 +8613,31 @@ public Mono> listDevicesNextSinglePageAsync( * *
{@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)
-     *             ]
+     *     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)
      * }
      * }
* @@ -6050,25 +8648,22 @@ public Mono> listDevicesNextSinglePageAsync( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of groups along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of deployments along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listGroupsNextSinglePageAsync( + private PagedResponse listDeploymentsForDeviceClassSubgroupNextSinglePage( 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)); + 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); } /** @@ -6078,23 +8673,11 @@ public Mono> listGroupsNextSinglePageAsync( * *
{@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)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     retryCount: int (Required)
+     *     movedOnToNewDeployment: boolean (Required)
+     *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
      * }
* @@ -6105,16 +8688,16 @@ public Mono> listGroupsNextSinglePageAsync( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of updatable devices for a device class subgroup along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of deployment device states along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listBestUpdatesForGroupNextSinglePageAsync( + private Mono> listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listBestUpdatesForGroupNext( + service.listDeviceStatesForDeviceClassSubgroupDeploymentNext( nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> @@ -6134,36 +8717,11 @@ public Mono> listBestUpdatesForGroupNextSinglePageAsyn * *
{@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)
-     *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     retryCount: int (Required)
+     *     movedOnToNewDeployment: boolean (Required)
+     *     deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      * }
      * }
* @@ -6174,25 +8732,22 @@ public Mono> listBestUpdatesForGroupNextSinglePageAsyn * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of deployment device states along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeploymentsForGroupNextSinglePageAsync( + private PagedResponse listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePage( 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)); + 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); } /** @@ -6202,16 +8757,27 @@ public Mono> listDeploymentsForGroupNextSinglePageAsyn * *
{@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             deviceClassId: String (Required)
-     *             groupId: String (Required)
-     *             createdDateTime: String (Required)
-     *             deviceCount: Integer (Optional)
-     *             deploymentId: 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)
      * }
      * }
* @@ -6222,16 +8788,16 @@ public Mono> listDeploymentsForGroupNextSinglePageAsyn * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request 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 + * @return the list of device operations with server paging support along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeviceClassSubgroupsForGroupNextSinglePageAsync( + private Mono> listOperationStatusesNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listDeviceClassSubgroupsForGroupNext( + service.listOperationStatusesNext( nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> @@ -6251,36 +8817,27 @@ public Mono> listDeviceClassSubgroupsForGroupNextSingl * *
{@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)
+     *     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)
      * }
      * }
* @@ -6291,25 +8848,22 @@ public Mono> listDeviceClassSubgroupsForGroupNextSingl * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of device operations with server paging support along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeploymentsForDeviceClassSubgroupNextSinglePageAsync( + private PagedResponse listOperationStatusesNextSinglePage( 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)); + 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); } /** @@ -6319,16 +8873,17 @@ public Mono> listDeploymentsForDeviceClassSubgroupNext * *
{@code
      * {
-     *     value (Required): [
+     *     operationId: String (Optional)
+     *     deviceList (Required): [
      *          (Required){
      *             deviceId: String (Required)
      *             moduleId: String (Optional)
-     *             retryCount: int (Required)
-     *             movedOnToNewDeployment: boolean (Required)
-     *             deviceState: String(Succeeded/InProgress/Canceled/Failed) (Required)
      *         }
      *     ]
-     *     nextLink: String (Optional)
+     *     description: String (Optional)
+     *     createdDateTime: String (Optional)
+     *     lastActionDateTime: String (Optional)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Optional)
      * }
      * }
* @@ -6339,16 +8894,16 @@ public Mono> listDeploymentsForDeviceClassSubgroupNext * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of deployment device states along with {@link PagedResponse} on successful completion of {@link - * Mono}. + * @return the list of log collections with server paging support along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listDeviceStatesForDeviceClassSubgroupDeploymentNextSinglePageAsync( + private Mono> listLogCollectionsNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listDeviceStatesForDeviceClassSubgroupDeploymentNext( + service.listLogCollectionsNext( nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> @@ -6368,32 +8923,17 @@ public Mono> listDeviceStatesForDeviceClassSubgroupDep * *
{@code
      * {
-     *     value (Required): [
+     *     operationId: String (Optional)
+     *     deviceList (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)
+     *             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)
      * }
      * }
* @@ -6404,26 +8944,21 @@ public Mono> listDeviceStatesForDeviceClassSubgroupDep * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of device operations with server paging support along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the list of log collections with server paging support along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOperationStatusesNextSinglePageAsync( - String nextLink, RequestOptions requestOptions) { + private PagedResponse listLogCollectionsNextSinglePage(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)); + 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); } /** @@ -6433,22 +8968,16 @@ public Mono> listOperationStatusesNextSinglePageAsync( * *
{@code
      * {
-     *     value (Required): [
+     *     deviceId: String (Required)
+     *     moduleId: String (Optional)
+     *     state: String(healthy/unhealthy) (Required)
+     *     digitalTwinModelId: String (Optional)
+     *     healthChecks (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)
+     *             name: String (Optional)
+     *             result: String(success/userError) (Optional)
      *         }
      *     ]
-     *     nextLink: String (Optional)
      * }
      * }
* @@ -6459,16 +8988,16 @@ public 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 the list of log collections with server paging support along with {@link PagedResponse} on successful + * @return array of Device Health, with server paging support along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listLogCollectionsNextSinglePageAsync( + private Mono> listHealthOfDevicesNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.listLogCollectionsNext( + service.listHealthOfDevicesNext( nextLink, this.client.getEndpoint(), accept, requestOptions, context)) .map( res -> @@ -6488,21 +9017,16 @@ public Mono> listLogCollectionsNextSinglePageAsync( * *
{@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)
      * }
      * }
* @@ -6513,26 +9037,22 @@ public Mono> listLogCollectionsNextSinglePageAsync( * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return array of Device Health, with server paging support along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return array of Device Health, with server paging support along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listHealthOfDevicesNextSinglePageAsync( + private PagedResponse listHealthOfDevicesNextSinglePage( 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)); + 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) { diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java index ca7029fd9a24..416bb366993d 100644 --- a/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/main/java/com/azure/iot/deviceupdate/implementation/DeviceUpdatesImpl.java @@ -33,6 +33,8 @@ 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; @@ -87,6 +89,26 @@ Mono> listUpdates( 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( @@ -108,6 +130,27 @@ Mono> importUpdate( 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( @@ -131,6 +174,29 @@ Mono> getUpdate( 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( @@ -154,6 +220,29 @@ Mono> deleteUpdate( 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( @@ -174,6 +263,26 @@ Mono> listProviders( 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( @@ -195,6 +304,27 @@ Mono> listNames( 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( @@ -217,6 +347,28 @@ Mono> listVersions( 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( @@ -240,6 +392,29 @@ Mono> listFiles( 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( @@ -264,6 +439,30 @@ Mono> getFile( 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( @@ -284,6 +483,26 @@ Mono> listOperationStatuses( 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( @@ -305,6 +524,27 @@ Mono> getOperationStatus( 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( @@ -324,6 +564,25 @@ Mono> listUpdatesNext( 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( @@ -355,7 +614,7 @@ Mono> listProvidersNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNamesNext( + Response listProvidersNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, @@ -374,7 +633,7 @@ Mono> listNamesNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listVersionsNext( + Mono> listNamesNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, @@ -393,7 +652,7 @@ Mono> listVersionsNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listFilesNext( + Response listNamesNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, @@ -412,18 +671,113 @@ Mono> listFilesNext( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listOperationStatusesNext( + Mono> listVersionsNext( @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 + @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 * * * @@ -438,48 +792,43 @@ Mono> listOperationStatusesNext( * *
{@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)
-     *             }
-     *             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)
-     *                     }
+     *             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)
-     *         }
+     *         ]
+     *     }
+     *     referencedBy (Optional): [
+     *         (recursive schema, see above)
      *     ]
-     *     nextLink: String (Optional)
+     *     scanResult: String (Optional)
+     *     manifestVersion: String (Required)
+     *     importedDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
      * }
      * }
* @@ -492,7 +841,7 @@ Mono> listOperationStatusesNext( * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listUpdatesSinglePageAsync(RequestOptions requestOptions) { + private Mono> listUpdatesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> @@ -532,48 +881,43 @@ public Mono> listUpdatesSinglePageAsync(RequestOptions * *
{@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)
-     *             }
-     *             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)
-     *                     }
+     *             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)
-     *         }
+     *         ]
+     *     }
+     *     referencedBy (Optional): [
+     *         (recursive schema, see above)
      *     ]
-     *     nextLink: String (Optional)
+     *     scanResult: String (Optional)
+     *     manifestVersion: String (Required)
+     *     importedDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
      * }
      * }
* @@ -615,62 +959,246 @@ public PagedFlux listUpdatesAsync(RequestOptions requestOptions) { * *
{@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){
+     *             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
+ * + * + * + * + *
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){
-     *             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)
-     *                     }
+     *             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)
-     *         }
+     *         ]
+     *     }
+     *     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 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 a list of all updates that have been imported to Device Update for IoT Hub as paginated response with - * {@link PagedIterable}. + * @return update metadata along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listUpdates(RequestOptions requestOptions) { - return new PagedIterable<>(listUpdatesAsync(requestOptions)); + @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)); } /** @@ -751,22 +1279,19 @@ public PagedIterable listUpdates(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 update metadata along with {@link Response} on successful completion of {@link Mono}. + * @return update metadata along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> importUpdateWithResponseAsync( - BinaryData updateToImport, RequestOptions requestOptions) { + private Response importUpdateWithResponse(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)); + return service.importUpdateSync( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + updateToImport, + accept, + requestOptions, + Context.NONE); } /** @@ -950,7 +1475,18 @@ public PollerFlux beginImportUpdateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginImportUpdate( BinaryData updateToImport, RequestOptions requestOptions) { - return this.beginImportUpdateAsync(updateToImport, requestOptions).getSyncPoller(); + 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)); } /** @@ -1108,7 +1644,17 @@ public Mono> getUpdateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Response getUpdateWithResponse( String provider, String name, String version, RequestOptions requestOptions) { - return getUpdateWithResponseAsync(provider, name, version, requestOptions).block(); + 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); } /** @@ -1143,6 +1689,36 @@ private Mono> deleteUpdateWithResponseAsync( 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. @@ -1192,7 +1768,18 @@ public PollerFlux beginDeleteUpdateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginDeleteUpdate( String provider, String name, String version, RequestOptions requestOptions) { - return this.beginDeleteUpdateAsync(provider, name, version, requestOptions).getSyncPoller(); + 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)); } /** @@ -1201,12 +1788,7 @@ public SyncPoller beginDeleteUpdate( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1218,7 +1800,7 @@ public SyncPoller beginDeleteUpdate( * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listProvidersSinglePageAsync(RequestOptions requestOptions) { + private Mono> listProvidersSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> @@ -1246,12 +1828,7 @@ public Mono> listProvidersSinglePageAsync(RequestOptio *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1280,12 +1857,44 @@ public PagedFlux listProvidersAsync(RequestOptions requestOptions) { *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * 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. @@ -1298,7 +1907,14 @@ public PagedFlux listProvidersAsync(RequestOptions requestOptions) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listProviders(RequestOptions requestOptions) { - return new PagedIterable<>(listProvidersAsync(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)); } /** @@ -1307,12 +1923,7 @@ public PagedIterable listProviders(RequestOptions requestOptions) { *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param provider Update provider. @@ -1325,7 +1936,7 @@ public PagedIterable listProviders(RequestOptions requestOptions) { * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNamesSinglePageAsync(String provider, RequestOptions requestOptions) { + private Mono> listNamesSinglePageAsync(String provider, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> @@ -1354,12 +1965,7 @@ public Mono> listNamesSinglePageAsync(String provider, *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param provider Update provider. @@ -1389,12 +1995,45 @@ public PagedFlux listNamesAsync(String provider, RequestOptions requ *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * 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. @@ -1408,7 +2047,14 @@ public PagedFlux listNamesAsync(String provider, RequestOptions requ */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listNames(String provider, RequestOptions requestOptions) { - return new PagedIterable<>(listNamesAsync(provider, 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)); } /** @@ -1427,12 +2073,7 @@ public PagedIterable listNames(String provider, RequestOptions reque *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param provider Update provider. @@ -1446,7 +2087,7 @@ public PagedIterable listNames(String provider, RequestOptions reque * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVersionsSinglePageAsync( + private Mono> listVersionsSinglePageAsync( String provider, String name, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( @@ -1487,12 +2128,7 @@ public Mono> listVersionsSinglePageAsync( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param provider Update provider. @@ -1533,12 +2169,59 @@ public PagedFlux listVersionsAsync(String provider, String name, Req *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * 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. @@ -1553,7 +2236,14 @@ public PagedFlux listVersionsAsync(String provider, String name, Req */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { - return new PagedIterable<>(listVersionsAsync(provider, name, 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)); } /** @@ -1562,12 +2252,7 @@ public PagedIterable listVersions(String provider, String name, Requ *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param provider Update provider. @@ -1582,7 +2267,7 @@ public PagedIterable listVersions(String provider, String name, Requ * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFilesSinglePageAsync( + private Mono> listFilesSinglePageAsync( String provider, String name, String version, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( @@ -1614,12 +2299,7 @@ public Mono> listFilesSinglePageAsync( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param provider Update provider. @@ -1633,17 +2313,60 @@ public Mono> listFilesSinglePageAsync( * @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( + @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) { - 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)); + 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); } /** @@ -1652,12 +2375,7 @@ public PagedFlux listFilesAsync( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param provider Update provider. @@ -1674,7 +2392,14 @@ public PagedFlux listFilesAsync( @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listFiles( String provider, String name, String version, RequestOptions requestOptions) { - return new PagedIterable<>(listFilesAsync(provider, name, version, 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)); } /** @@ -1824,7 +2549,18 @@ public Mono> getFileWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) public Response getFileWithResponse( String provider, String name, String version, String fileId, RequestOptions requestOptions) { - return getFileWithResponseAsync(provider, name, version, fileId, requestOptions).block(); + 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); } /** @@ -1846,42 +2582,37 @@ public Response getFileWithResponse( * *
{@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)
      * }
      * }
* @@ -1894,7 +2625,7 @@ public Response getFileWithResponse( * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOperationStatusesSinglePageAsync(RequestOptions requestOptions) { + private Mono> listOperationStatusesSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> @@ -1935,42 +2666,37 @@ public Mono> listOperationStatusesSinglePageAsync(Requ * *
{@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)
      * }
      * }
* @@ -2012,42 +2738,117 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp * *
{@code
      * {
-     *     value (Required): [
-     *          (Required){
-     *             operationId: String (Required)
-     *             status: String(NotStarted/Running/Succeeded/Failed) (Required)
-     *             update (Optional): {
-     *                 updateId (Required): {
-     *                     provider: String (Required)
-     *                     name: String (Required)
-     *                     version: String (Required)
-     *                 }
-     *                 description: String (Optional)
-     *                 friendlyName: String (Optional)
-     *             }
-     *             resourceLocation: String (Optional)
-     *             error (Optional): {
-     *                 code: String (Required)
-     *                 message: String (Required)
-     *                 target: String (Optional)
-     *                 details (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *                 innererror (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Optional)
-     *                     errorDetail: String (Optional)
-     *                     innerError (Optional): (recursive schema, see innerError above)
-     *                 }
-     *                 occurredDateTime: OffsetDateTime (Optional)
-     *             }
-     *             traceId: String (Optional)
-     *             lastActionDateTime: OffsetDateTime (Required)
-     *             createdDateTime: OffsetDateTime (Required)
-     *             etag: String (Optional)
+     *     operationId: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed) (Required)
+     *     update (Optional): {
+     *         updateId (Required): {
+     *             provider: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
      *         }
-     *     ]
-     *     nextLink: String (Optional)
+     *         description: String (Optional)
+     *         friendlyName: String (Optional)
+     *     }
+     *     resourceLocation: String (Optional)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Required)
+     *             message: String (Optional)
+     *             errorDetail: String (Optional)
+     *             innerError (Optional): (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime (Optional)
+     *     }
+     *     traceId: String (Optional)
+     *     lastActionDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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)
      * }
      * }
* @@ -2060,7 +2861,14 @@ public PagedFlux listOperationStatusesAsync(RequestOptions requestOp */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listOperationStatuses(RequestOptions requestOptions) { - return new PagedIterable<>(listOperationStatusesAsync(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)); } /** @@ -2189,17 +2997,100 @@ public Mono> getOperationStatusWithResponseAsync( * } * }
* - * @param operationId Operation identifier. + * @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 operation metadata along with {@link Response}. + * @return the list of updates along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) { - return getOperationStatusWithResponseAsync(operationId, requestOptions).block(); + 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)); } /** @@ -2209,48 +3100,43 @@ public Response getOperationStatusWithResponse(String operationId, R * *

{@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)
-     *             }
-     *             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)
-     *                     }
+     *             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)
-     *         }
+     *         ]
+     *     }
+     *     referencedBy (Optional): [
+     *         (recursive schema, see above)
      *     ]
-     *     nextLink: String (Optional)
+     *     scanResult: String (Optional)
+     *     manifestVersion: String (Required)
+     *     importedDateTime: OffsetDateTime (Required)
+     *     createdDateTime: OffsetDateTime (Required)
+     *     etag: String (Optional)
      * }
      * }
* @@ -2261,25 +3147,20 @@ public Response getOperationStatusWithResponse(String operationId, R * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the list of updates along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the list of updates along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listUpdatesNextSinglePageAsync( - String nextLink, RequestOptions requestOptions) { + private PagedResponse listUpdatesNextSinglePage(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)); + 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); } /** @@ -2288,12 +3169,7 @@ public Mono> listUpdatesNextSinglePageAsync( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * String
      * }
* * @param nextLink The URL to get the next list of items @@ -2307,7 +3183,7 @@ public Mono> listUpdatesNextSinglePageAsync( * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listProvidersNextSinglePageAsync( + private Mono> listProvidersNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( @@ -2331,12 +3207,40 @@ public Mono> listProvidersNextSinglePageAsync( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * 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 @@ -2350,7 +3254,7 @@ public Mono> listProvidersNextSinglePageAsync( * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listNamesNextSinglePageAsync( + private Mono> listNamesNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( @@ -2374,12 +3278,39 @@ public Mono> listNamesNextSinglePageAsync( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * 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 @@ -2393,7 +3324,7 @@ public Mono> listNamesNextSinglePageAsync( * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listVersionsNextSinglePageAsync( + private Mono> listVersionsNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( @@ -2417,12 +3348,39 @@ public Mono> listVersionsNextSinglePageAsync( *

Response Body Schema * *

{@code
-     * {
-     *     value (Required): [
-     *         String (Required)
-     *     ]
-     *     nextLink: String (Optional)
-     * }
+     * 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 @@ -2436,7 +3394,7 @@ public Mono> listVersionsNextSinglePageAsync( * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listFilesNextSinglePageAsync( + private Mono> listFilesNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( @@ -2454,6 +3412,38 @@ public Mono> listFilesNextSinglePageAsync( 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. * @@ -2461,42 +3451,37 @@ public Mono> listFilesNextSinglePageAsync( * *

{@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)
      * }
      * }
* @@ -2511,7 +3496,7 @@ public Mono> listFilesNextSinglePageAsync( * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listOperationStatusesNextSinglePageAsync( + private Mono> listOperationStatusesNextSinglePageAsync( String nextLink, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( @@ -2529,6 +3514,72 @@ public Mono> listOperationStatusesNextSinglePageAsync( 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); diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceManagementClientSyncStackTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceManagementClientSyncStackTests.java new file mode 100644 index 000000000000..5d970d98b58b --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceManagementClientSyncStackTests.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.iot.deviceupdate; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +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.http.rest.Response; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public class DeviceManagementClientSyncStackTests extends TestProxyTestBase { + protected DeviceManagementClient deviceManagementClient; + private RequestOptions requestOptions; + + @Override + protected void beforeTest() { + DeviceManagementClientBuilder deviceManagementClientbuilder = + new DeviceManagementClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", TestData.ACCOUNT_ENDPOINT)) + .instanceId(Configuration.getGlobalConfiguration().get("INSTANCEID", TestData.INSTANCE_ID)) + .httpClient(buildSyncAssertingClient(HttpClient.createDefault())) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + deviceManagementClientbuilder + .httpClient(buildSyncAssertingClient(interceptorManager.getPlaybackClient())) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } 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(); + + requestOptions = new RequestOptions(); + } + + @Test + public void testListGroups() { + PagedIterable response = deviceManagementClient.listGroups(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetGroup() { + Response response = deviceManagementClient.getGroupWithResponse(TestData.DEVICE_GROUP, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListBestUpdatesForGroup() { + PagedIterable response = deviceManagementClient.listBestUpdatesForGroup(TestData.DEVICE_GROUP, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testListDeviceClassSubgroupsForGroup() { + PagedIterable response = + deviceManagementClient.listDeviceClassSubgroupsForGroup(TestData.DEVICE_GROUP, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetUpdateCompliance() { + Response response = deviceManagementClient.getUpdateComplianceWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testGetUpdateComplianceForGroup() { + Response response = + deviceManagementClient.getUpdateComplianceForGroupWithResponse(TestData.DEVICE_GROUP, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListDevices() { + PagedIterable response = deviceManagementClient.listDevices(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetDevice() { + Response response = deviceManagementClient.getDeviceWithResponse(TestData.DEVICE_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListDeviceClasses() { + PagedIterable response = deviceManagementClient.listDeviceClasses(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testListHealthOfDevices() { + PagedIterable response = + deviceManagementClient.listHealthOfDevices("state eq 'Healthy'", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetDeviceClass() { + Response response = + deviceManagementClient.getDeviceClassWithResponse(TestData.DEVICE_CLASS_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListInstallableUpdatesForDeviceClass() { + PagedIterable response = + deviceManagementClient.listInstallableUpdatesForDeviceClass(TestData.DEVICE_CLASS_ID, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetDeviceClassSubgroup() { + Response response = + deviceManagementClient.getDeviceClassSubgroupWithResponse(TestData.DEVICE_GROUP, TestData.DEVICE_CLASS_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListBestUpdatesForDeviceClassSubgroup() { + Response response = + deviceManagementClient.getBestUpdatesForDeviceClassSubgroupWithResponse( + TestData.DEVICE_GROUP, TestData.DEVICE_CLASS_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testGetDeviceClassSubgroupUpdateCompliance() { + Response response = + deviceManagementClient.getDeviceClassSubgroupUpdateComplianceWithResponse( + TestData.DEVICE_GROUP, TestData.DEVICE_CLASS_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListDeploymentsForGroup() { + PagedIterable response = + deviceManagementClient.listDeploymentsForGroup(TestData.DEVICE_GROUP, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetDeployment() { + Response response = + deviceManagementClient.getDeploymentWithResponse(TestData.DEVICE_GROUP, TestData.DEPLOYMENT_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListDeploymentsForDeviceClassSubgroup() { + PagedIterable response = + deviceManagementClient.listDeploymentsForDeviceClassSubgroup( + TestData.DEVICE_GROUP, TestData.DEVICE_CLASS_ID, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetDeploymentForDeviceClassSubgroup() { + Response response = + deviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse( + TestData.DEVICE_GROUP, TestData.DEVICE_CLASS_ID, TestData.DEPLOYMENT_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testGetDeploymentStatus() { + Response response = + deviceManagementClient.getDeploymentStatusWithResponse(TestData.DEVICE_GROUP, TestData.DEPLOYMENT_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testGetDeviceClassSubgroupDeploymentStatus() { + Response response = + deviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse( + TestData.DEVICE_GROUP, TestData.DEVICE_CLASS_ID, TestData.DEPLOYMENT_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListDeviceStatesForDeviceClassSubgroupDeployment() { + PagedIterable response = + deviceManagementClient.listDeviceStatesForDeviceClassSubgroupDeployment( + TestData.DEVICE_GROUP, TestData.DEVICE_CLASS_ID, TestData.DEPLOYMENT_ID, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + private HttpClient buildSyncAssertingClient(HttpClient httpClient) { + return new AssertingHttpClientBuilder(httpClient) + .assertSync() + .build(); + } +} diff --git a/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientSyncStackTests.java b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientSyncStackTests.java new file mode 100644 index 000000000000..736bd7bcbcb5 --- /dev/null +++ b/sdk/deviceupdate/azure-iot-deviceupdate/src/test/java/com/azure/iot/deviceupdate/DeviceUpdateClientSyncStackTests.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.iot.deviceupdate; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +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.http.rest.Response; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public class DeviceUpdateClientSyncStackTests extends TestProxyTestBase { + protected DeviceUpdateClient deviceUpdateClient; + private RequestOptions requestOptions; + + @Override + protected void beforeTest() { + DeviceUpdateClientBuilder deviceUpdateClientbuilder = + new DeviceUpdateClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", TestData.ACCOUNT_ENDPOINT)) + .instanceId(Configuration.getGlobalConfiguration().get("INSTANCEID", TestData.INSTANCE_ID)) + .httpClient(buildSyncAssertingClient(HttpClient.createDefault())) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + deviceUpdateClientbuilder + .httpClient(buildSyncAssertingClient(interceptorManager.getPlaybackClient())) + .credential(request -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX))); + } 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(); + + requestOptions = new RequestOptions(); + } + + @Test + public void testListProviders() { + PagedIterable response = deviceUpdateClient.listProviders(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testListNames() { + PagedIterable response = deviceUpdateClient.listNames(TestData.PROVIDER, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testListVersions() { + PagedIterable response = deviceUpdateClient.listVersions(TestData.PROVIDER, TestData.NAME, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testListFiles() { + PagedIterable response = + deviceUpdateClient.listFiles(TestData.PROVIDER, TestData.NAME, TestData.VERSION, requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetFile() { + Response response = + deviceUpdateClient.getFileWithResponse(TestData.PROVIDER, TestData.NAME, TestData.VERSION, TestData.FILE_ID, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + @Test + public void testListUpdates() { + PagedIterable response = deviceUpdateClient.listUpdates(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertTrue(response.stream().findAny().isPresent()); + } + + @Test + public void testGetUpdate() { + Response response = + deviceUpdateClient.getUpdateWithResponse(TestData.PROVIDER, TestData.NAME, TestData.VERSION, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertNotNull(response.getValue()); + } + + private HttpClient buildSyncAssertingClient(HttpClient httpClient) { + return new AssertingHttpClientBuilder(httpClient) + .assertSync() + .build(); + } +} 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 e42b1d765df8..06169030fcb8 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,17 +10,25 @@ public class TestData { public static final String CLIENT_ID = getTestValue("CLIENT_ID", "clientId"); public static final String ACCOUNT_ENDPOINT = getTestValue("ACCOUNT_ENDPOINT", - "contosoprod.api.prod.adu.microsoft.com"); + "contosoprodwus2.api.adu.microsoft.com"); - public static final String INSTANCE_ID = getTestValue("INSTANCE_ID", "sdkinstance"); + public static final String INSTANCE_ID = getTestValue("INSTANCE_ID", "blue"); - public static final String PROVIDER = "fabrikam"; + public static final String PROVIDER = "sdk-tests-provider"; - public static final String NAME = "vacuum"; + public static final String NAME = "sdk-tests-name"; - public static final String VERSION = "2022.401.504.6"; + public static final String FILE_ID = "f25626693f7c20ff8"; - public static final String DEVICE_GROUP = "dpokluda-test"; + public static final String VERSION = "2.0.0.0"; + + public static final String DEVICE_GROUP = "sdk-tests-group"; + + public static final String DEVICE_CLASS_ID = "c61300e6b3da62926c23d92519ea3f2e73116e71"; + + public static final String DEVICE_ID = "sdk-tests-638309378295188213"; + + public static final String DEPLOYMENT_ID = "sdk-tests-deployment"; private static String getTestValue(String name, String defaultValue) { if (Configuration.getGlobalConfiguration().contains(name)) {