diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 73c9c09196c0..553b09416c8b 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -149,6 +149,7 @@ com.azure:azure-template-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-verticals-agrifood-farming;1.0.0-beta.2;1.0.0-beta.3 com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 +com.azure:azure-deviceupdate-deviceupdate;1.0.0-beta.1;1.0.0-beta.1 com.microsoft.azure:spring-cloud-azure-appconfiguration-config-web;1.3.0;1.4.0-beta.1 com.microsoft.azure:spring-cloud-azure-appconfiguration-config;1.3.0;1.4.0-beta.1 com.microsoft.azure:spring-cloud-azure-feature-management-web;1.3.0;1.4.0-beta.1 diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/CHANGELOG.md b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/CHANGELOG.md new file mode 100644 index 000000000000..f0f749605edf --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +- Azure DeviceUpdateClient client library for Java. This package contains Microsoft Azure DeviceUpdateClient client library. + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/README.md b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/README.md new file mode 100644 index 000000000000..7e1221a27c95 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/README.md @@ -0,0 +1,63 @@ +# Azure DeviceUpdateClient client library for Java + +Azure DeviceUpdateClient client library for Java. + +This package contains Microsoft Azure DeviceUpdateClient client library. + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] +- [Product documentation][product_documentation] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-deviceupdate-deviceupdate;current}) +```xml + + com.azure + azure-deviceupdate-deviceupdate + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Authentication + +[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. + +## Key concepts + +## Examples + +```java com.azure.deviceupdate.deviceupdate.readme +``` + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://azure.microsoft.com/services/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/pom.xml b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/pom.xml new file mode 100644 index 000000000000..ea8761ca3d6b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/pom.xml @@ -0,0 +1,79 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-deviceupdate-deviceupdate + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for DeviceUpdateClient Management + This package contains Microsoft Azure DeviceUpdateClient client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.28.0 + + + com.azure + azure-core-http-netty + 1.12.0 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + com.azure + azure-core-test + 1.8.0 + test + + + com.azure + azure-identity + 1.5.1 + test + + + org.slf4j + slf4j-simple + 1.7.36 + test + + + diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementAsyncClient.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementAsyncClient.java new file mode 100644 index 000000000000..d2a7adf76a8c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementAsyncClient.java @@ -0,0 +1,1785 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.PollerFlux; +import com.azure.deviceupdate.deviceupdate.implementation.DeviceManagementsImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous DeviceUpdateClient type. */ +@ServiceClient(builder = DeviceManagementClientBuilder.class, isAsync = true) +public final class DeviceManagementAsyncClient { + @Generated private final DeviceManagementsImpl serviceClient; + + /** + * Initializes an instance of DeviceManagementAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + DeviceManagementAsyncClient(DeviceManagementsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceClasses(RequestOptions requestOptions) { + return this.serviceClient.listDeviceClassesAsync(requestOptions); + } + + /** + * Gets the properties of a device class. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the properties of a device class along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.getDeviceClassWithResponseAsync(deviceClassId, requestOptions); + } + + /** + * Update device class details. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     friendlyName: String
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateDeviceClassWithResponse( + String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions) { + return this.serviceClient.updateDeviceClassWithResponseAsync(deviceClassId, deviceClassPatch, requestOptions); + } + + /** + * Deletes a device class. + * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.deleteDeviceClassWithResponseAsync(deviceClassId, requestOptions); + } + + /** + * Gets a list of installable updates for a device class. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of installable updates for a device class as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listInstallableUpdatesForDeviceClass( + String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.listInstallableUpdatesForDeviceClassAsync(deviceClassId, requestOptions); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 devices connected to Device Update for IoT Hub as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDevices(RequestOptions requestOptions) { + return this.serviceClient.listDevicesAsync(requestOptions); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header + * value to check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * String(Devices/Modules/All)
+     * }
+ * + * @param importType The types of devices to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> importDevicesWithResponse(BinaryData importType, RequestOptions requestOptions) { + return this.serviceClient.importDevicesWithResponseAsync(importType, requestOptions); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header + * value to check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * String(Devices/Modules/All)
+     * }
+ * + * @param importType The types of devices to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportDevices(BinaryData importType, RequestOptions requestOptions) { + return this.serviceClient.beginImportDevicesAsync(importType, requestOptions); + } + + /** + * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub + * along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { + return this.serviceClient.getDeviceWithResponseAsync(deviceId, requestOptions); + } + + /** + * Gets the device module properties and latest deployment status for a device module connected to Device Update for + * IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param moduleId Device module identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device module properties and latest deployment status for a device module connected to Device Update + * for IoT Hub along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceModuleWithResponse( + String deviceId, String moduleId, RequestOptions requestOptions) { + return this.serviceClient.getDeviceModuleWithResponseAsync(deviceId, moduleId, requestOptions); + } + + /** + * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress + * receiving new updates. + * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 device groups as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGroups(RequestOptions requestOptions) { + return this.serviceClient.listGroupsAsync(requestOptions); + } + + /** + * Gets the device group properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     groupType: String(IoTHubTag/DefaultNoTag)
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     subgroupsWithNewUpdatesAvailableCount: Integer
+     *     subgroupsWithUpdatesInProgressCount: Integer
+     *     subgroupsWithOnLatestUpdateCount: Integer
+     *     deployments: [
+     *         String
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device group properties along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGroupWithResponse(String groupId, RequestOptions requestOptions) { + return this.serviceClient.getGroupWithResponseAsync(groupId, requestOptions); + } + + /** + * Deletes a device group. + * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { + return this.serviceClient.deleteGroupWithResponseAsync(groupId, requestOptions); + } + + /** + * Get device group update compliance information such as how many devices are on their latest update, how many need + * new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device group update compliance information such as how many devices are on their latest update, how many + * need new updates, and how many are in progress on receiving a new update along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGroupUpdateComplianceWithResponse( + String groupId, RequestOptions requestOptions) { + return this.serviceClient.getGroupUpdateComplianceWithResponseAsync(groupId, requestOptions); + } + + /** + * Get the best available updates for a device group and a count of how many devices need each update. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.
+ * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device group as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { + return this.serviceClient.listDeploymentsForGroupAsync(groupId, requestOptions); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.getDeploymentWithResponseAsync(groupId, deploymentId, requestOptions); + } + + /** + * Creates or updates a deployment. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param deployment The deployment properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateDeploymentWithResponse( + String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateDeploymentWithResponseAsync( + groupId, deploymentId, deployment, requestOptions); + } + + /** + * Deletes a deployment. + * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeploymentWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.deleteDeploymentWithResponseAsync(groupId, deploymentId, requestOptions); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     subgroupStatus: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             deploymentState: String(Active/Failed/Inactive/Canceled)
+     *             error: (recursive schema, see error above)
+     *             totalDevices: Integer
+     *             devicesInProgressCount: Integer
+     *             devicesCompletedFailedCount: Integer
+     *             devicesCompletedSucceededCount: Integer
+     *             devicesCanceledCount: Integer
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentStatusWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.getDeploymentStatusWithResponseAsync(groupId, deploymentId, requestOptions); + } + + /** + * Get the device class subgroups for the group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             groupId: String
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             deploymentId: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeviceClassSubgroupsForGroupWithResponse( + String groupId, RequestOptions requestOptions) { + return this.serviceClient.listDeviceClassSubgroupsForGroupWithResponseAsync(groupId, requestOptions); + } + + /** + * Gets device class subgroup details. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     groupId: String
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     deploymentId: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup details along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupDetailsWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.getDeviceClassSubgroupDetailsWithResponseAsync( + groupId, deviceClassId, requestOptions); + } + + /** + * Deletes a device class subgroup. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.deleteDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions); + } + + /** + * Get device class subgroup update compliance information such as how many devices are on their latest update, how + * many need new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup update compliance information such as how many devices are on their latest update, + * how many need new updates, and how many are in progress on receiving a new update along with {@link Response} + * on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupUpdateComplianceWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.getDeviceClassSubgroupUpdateComplianceWithResponseAsync( + groupId, deviceClassId, requestOptions); + } + + /** + * Get the best available update for a device class subgroup and a count of how many devices need this update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the best available update for a device class subgroup and a count of how many devices need this update + * along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBestUpdatesForDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.listBestUpdatesForDeviceClassSubgroupWithResponseAsync( + groupId, deviceClassId, requestOptions); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForDeviceClassSubgroup( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.serviceClient.listDeploymentsForDeviceClassSubgroupAsync(groupId, deviceClassId, requestOptions); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentForDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.getDeploymentForDeviceClassSubgroupWithResponseAsync( + groupId, deviceClassId, deploymentId, requestOptions); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeviceClassSubgroupDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.deleteDeviceClassSubgroupDeploymentWithResponseAsync( + groupId, deviceClassId, deploymentId, requestOptions); + } + + /** + * Stops a deployment. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.stopDeploymentWithResponseAsync(groupId, deviceClassId, deploymentId, requestOptions); + } + + /** + * Retries a deployment with failed devices. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> retryDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.retryDeploymentWithResponseAsync( + groupId, deviceClassId, deploymentId, requestOptions); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     deploymentState: String(Active/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     totalDevices: Integer
+     *     devicesInProgressCount: Integer
+     *     devicesCompletedFailedCount: Integer
+     *     devicesCompletedSucceededCount: Integer
+     *     devicesCanceledCount: Integer
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupDeploymentStatusWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.getDeviceClassSubgroupDeploymentStatusWithResponseAsync( + groupId, deviceClassId, deploymentId, requestOptions); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of devices in a deployment along with their state as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDevicesForDeviceClassSubgroupDeployment( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.serviceClient.listDevicesForDeviceClassSubgroupDeploymentAsync( + groupId, deviceClassId, deploymentId, requestOptions); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return this.serviceClient.getOperationWithResponseAsync(operationId, requestOptions); + } + + /** + * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 device import operations as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperations(RequestOptions requestOptions) { + return this.serviceClient.listOperationsAsync(requestOptions); + } + + /** + * Start the device diagnostics log collection operation on specified devices. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param logCollectionRequest 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 diagnostics request body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> collectLogsWithResponse( + String operationId, BinaryData logCollectionRequest, RequestOptions requestOptions) { + return this.serviceClient.collectLogsWithResponseAsync(operationId, logCollectionRequest, requestOptions); + } + + /** + * Get the device diagnostics log collection operation. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogCollectionOperationWithResponse( + String operationId, RequestOptions requestOptions) { + return this.serviceClient.getLogCollectionOperationWithResponseAsync(operationId, requestOptions); + } + + /** + * Get all device diagnostics log collection operations. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: 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 all device diagnostics log collection operations as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLogCollectionOperations(RequestOptions requestOptions) { + return this.serviceClient.listLogCollectionOperationsAsync(requestOptions); + } + + /** + * Get device diagnostics log collection operation with detailed status. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     deviceStatus: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             resultCode: String
+     *             extendedResultCode: String
+     *             logLocation: String
+     *         }
+     *     ]
+     *     description: String
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation with detailed status along with {@link Response} on + * successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogCollectionOperationDetailedStatusWithResponse( + String operationId, RequestOptions requestOptions) { + return this.serviceClient.getLogCollectionOperationDetailedStatusWithResponseAsync(operationId, requestOptions); + } + + /** + * Get list of device health. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             state: String(healthy/unhealthy)
+     *             digitalTwinModelId: String
+     *             healthChecks: [
+     *                 {
+     *                     name: String
+     *                     result: String(success/userError)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param filter Filter list by specified 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 list of device health along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeviceHealthWithResponse(String filter, RequestOptions requestOptions) { + return this.serviceClient.listDeviceHealthWithResponseAsync(filter, requestOptions); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementClient.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementClient.java new file mode 100644 index 000000000000..b8af4cdf969b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementClient.java @@ -0,0 +1,1763 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; + +/** Initializes a new instance of the synchronous DeviceUpdateClient type. */ +@ServiceClient(builder = DeviceManagementClientBuilder.class) +public final class DeviceManagementClient { + @Generated private final DeviceManagementAsyncClient client; + + /** + * Initializes an instance of DeviceManagementClient class. + * + * @param client the async client. + */ + @Generated + DeviceManagementClient(DeviceManagementAsyncClient client) { + this.client = client; + } + + /** + * Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeviceClasses(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listDeviceClasses(requestOptions)); + } + + /** + * Gets the properties of a device class. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the properties of a device class along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { + return this.client.getDeviceClassWithResponse(deviceClassId, requestOptions).block(); + } + + /** + * Update device class details. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     friendlyName: String
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param deviceClassPatch The device class json merge patch body. Currently only supports patching friendlyName. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class metadata along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateDeviceClassWithResponse( + String deviceClassId, BinaryData deviceClassPatch, RequestOptions requestOptions) { + return this.client.updateDeviceClassWithResponse(deviceClassId, deviceClassPatch, requestOptions).block(); + } + + /** + * Deletes a device class. + * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) { + return this.client.deleteDeviceClassWithResponse(deviceClassId, requestOptions).block(); + } + + /** + * Gets a list of installable updates for a device class. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of installable updates for a device class as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listInstallableUpdatesForDeviceClass( + String deviceClassId, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listInstallableUpdatesForDeviceClass(deviceClassId, requestOptions)); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 devices connected to Device Update for IoT Hub as paginated response with {@link + * PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDevices(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listDevices(requestOptions)); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header + * value to check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * String(Devices/Modules/All)
+     * }
+ * + * @param importType The types of devices to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportDevices(BinaryData importType, RequestOptions requestOptions) { + return this.client.beginImportDevices(importType, requestOptions).getSyncPoller(); + } + + /** + * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub + * along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { + return this.client.getDeviceWithResponse(deviceId, requestOptions).block(); + } + + /** + * Gets the device module properties and latest deployment status for a device module connected to Device Update for + * IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param moduleId Device module identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device module properties and latest deployment status for a device module connected to Device Update + * for IoT Hub along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceModuleWithResponse( + String deviceId, String moduleId, RequestOptions requestOptions) { + return this.client.getDeviceModuleWithResponse(deviceId, moduleId, requestOptions).block(); + } + + /** + * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress + * receiving new updates. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the breakdown of how many devices are on their latest update, have new updates available, or are in + * progress receiving new updates along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateComplianceWithResponse(RequestOptions requestOptions) { + return this.client.getUpdateComplianceWithResponse(requestOptions).block(); + } + + /** + * 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 any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 device groups as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroups(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listGroups(requestOptions)); + } + + /** + * Gets the device group properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     groupType: String(IoTHubTag/DefaultNoTag)
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     subgroupsWithNewUpdatesAvailableCount: Integer
+     *     subgroupsWithUpdatesInProgressCount: Integer
+     *     subgroupsWithOnLatestUpdateCount: Integer
+     *     deployments: [
+     *         String
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device group properties along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGroupWithResponse(String groupId, RequestOptions requestOptions) { + return this.client.getGroupWithResponse(groupId, requestOptions).block(); + } + + /** + * Deletes a device group. + * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { + return this.client.deleteGroupWithResponse(groupId, requestOptions).block(); + } + + /** + * 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
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device group update compliance information such as how many devices are on their latest update, how many + * need new updates, and how many are in progress on receiving a new update along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGroupUpdateComplianceWithResponse(String groupId, RequestOptions requestOptions) { + return this.client.getGroupUpdateComplianceWithResponse(groupId, requestOptions).block(); + } + + /** + * Get the best available updates for a device group and a count of how many devices need each update. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.
+ * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device group as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listDeploymentsForGroup(groupId, requestOptions)); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return this.client.getDeploymentWithResponse(groupId, deploymentId, requestOptions).block(); + } + + /** + * Creates or updates a deployment. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param deployment The deployment properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateDeploymentWithResponse( + String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { + return this.client + .createOrUpdateDeploymentWithResponse(groupId, deploymentId, deployment, requestOptions) + .block(); + } + + /** + * Deletes a deployment. + * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeploymentWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return this.client.deleteDeploymentWithResponse(groupId, deploymentId, requestOptions).block(); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     subgroupStatus: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             deploymentState: String(Active/Failed/Inactive/Canceled)
+     *             error: (recursive schema, see error above)
+     *             totalDevices: Integer
+     *             devicesInProgressCount: Integer
+     *             devicesCompletedFailedCount: Integer
+     *             devicesCompletedSucceededCount: Integer
+     *             devicesCanceledCount: Integer
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentStatusWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return this.client.getDeploymentStatusWithResponse(groupId, deploymentId, requestOptions).block(); + } + + /** + * Get the device class subgroups for the group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             groupId: String
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             deploymentId: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listDeviceClassSubgroupsForGroupWithResponse( + String groupId, RequestOptions requestOptions) { + return this.client.listDeviceClassSubgroupsForGroupWithResponse(groupId, requestOptions).block(); + } + + /** + * Gets device class subgroup details. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     groupId: String
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     deploymentId: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup details along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceClassSubgroupDetailsWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.client.getDeviceClassSubgroupDetailsWithResponse(groupId, deviceClassId, requestOptions).block(); + } + + /** + * Deletes a device class subgroup. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.client.deleteDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions).block(); + } + + /** + * Get device class subgroup update compliance information such as how many devices are on their latest update, how + * many need new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup update compliance information such as how many devices are on their latest update, + * how many need new updates, and how many are in progress on receiving a new update along with {@link + * Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceClassSubgroupUpdateComplianceWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.client + .getDeviceClassSubgroupUpdateComplianceWithResponse(groupId, deviceClassId, requestOptions) + .block(); + } + + /** + * 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
+     *     deviceClassId: String
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the best available update for a device class subgroup and a count of how many devices need this update + * along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBestUpdatesForDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return this.client + .listBestUpdatesForDeviceClassSubgroupWithResponse(groupId, deviceClassId, requestOptions) + .block(); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForDeviceClassSubgroup( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return new PagedIterable<>( + this.client.listDeploymentsForDeviceClassSubgroup(groupId, deviceClassId, requestOptions)); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentForDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.client + .getDeploymentForDeviceClassSubgroupWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .block(); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeviceClassSubgroupDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.client + .deleteDeviceClassSubgroupDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions) + .block(); + } + + /** + * Stops a deployment. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.client.stopDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions).block(); + } + + /** + * Retries a deployment with failed devices. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response retryDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.client.retryDeploymentWithResponse(groupId, deviceClassId, deploymentId, requestOptions).block(); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     deploymentState: String(Active/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     totalDevices: Integer
+     *     devicesInProgressCount: Integer
+     *     devicesCompletedFailedCount: Integer
+     *     devicesCompletedSucceededCount: Integer
+     *     devicesCanceledCount: Integer
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceClassSubgroupDeploymentStatusWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return this.client + .getDeviceClassSubgroupDeploymentStatusWithResponse( + groupId, deviceClassId, deploymentId, requestOptions) + .block(); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of devices in a deployment along with their state as paginated response with {@link + * PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDevicesForDeviceClassSubgroupDeployment( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return new PagedIterable<>( + this.client.listDevicesForDeviceClassSubgroupDeployment( + groupId, deviceClassId, deploymentId, requestOptions)); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation metadata along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return this.client.getOperationWithResponse(operationId, requestOptions).block(); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 device import operations as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperations(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listOperations(requestOptions)); + } + + /** + * Start the device diagnostics log collection operation on specified devices. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param logCollectionRequest 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 diagnostics request body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response collectLogsWithResponse( + String operationId, BinaryData logCollectionRequest, RequestOptions requestOptions) { + return this.client.collectLogsWithResponse(operationId, logCollectionRequest, requestOptions).block(); + } + + /** + * Get the device diagnostics log collection operation. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogCollectionOperationWithResponse( + String operationId, RequestOptions requestOptions) { + return this.client.getLogCollectionOperationWithResponse(operationId, requestOptions).block(); + } + + /** + * Get all device diagnostics log collection operations. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: 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 all device diagnostics log collection operations as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLogCollectionOperations(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listLogCollectionOperations(requestOptions)); + } + + /** + * Get device diagnostics log collection operation with detailed status. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     deviceStatus: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             resultCode: String
+     *             extendedResultCode: String
+     *             logLocation: String
+     *         }
+     *     ]
+     *     description: String
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation with detailed status along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogCollectionOperationDetailedStatusWithResponse( + String operationId, RequestOptions requestOptions) { + return this.client.getLogCollectionOperationDetailedStatusWithResponse(operationId, requestOptions).block(); + } + + /** + * Get list of device health. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             state: String(healthy/unhealthy)
+     *             digitalTwinModelId: String
+     *             healthChecks: [
+     *                 {
+     *                     name: String
+     *                     result: String(success/userError)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param filter Filter list by specified 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 list of device health along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listDeviceHealthWithResponse(String filter, RequestOptions requestOptions) { + return this.client.listDeviceHealthWithResponse(filter, requestOptions).block(); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementClientBuilder.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementClientBuilder.java new file mode 100644 index 000000000000..2f3964ec77d1 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceManagementClientBuilder.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.deviceupdate.deviceupdate.implementation.DeviceUpdateClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the DeviceManagementClient type. */ +@ServiceClientBuilder(serviceClients = {DeviceManagementClient.class, DeviceManagementAsyncClient.class}) +public final class DeviceManagementClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://api.adu.microsoft.com/.default"}; + + @Generated + private final Map properties = + CoreUtils.getProperties("azure-deviceupdate-deviceupdate.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the DeviceManagementClientBuilder. */ + @Generated + public DeviceManagementClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a + * request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service + * client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Account instance identifier. + */ + @Generated private String instanceId; + + /** + * Sets Account instance identifier. + * + * @param instanceId the instanceId value. + * @return the DeviceManagementClientBuilder. + */ + @Generated + public DeviceManagementClientBuilder instanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /* + * Service version + */ + @Generated private DeviceUpdateServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the DeviceManagementClientBuilder. + */ + @Generated + public DeviceManagementClientBuilder serviceVersion(DeviceUpdateServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if + * applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the DeviceManagementClientBuilder. + */ + @Generated + public DeviceManagementClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of DeviceUpdateClientImpl with the provided parameters. + * + * @return an instance of DeviceUpdateClientImpl. + */ + @Generated + private DeviceUpdateClientImpl buildInnerClient() { + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + if (serviceVersion == null) { + this.serviceVersion = DeviceUpdateServiceVersion.getLatest(); + } + DeviceUpdateClientImpl client = + new DeviceUpdateClientImpl( + pipeline, + JacksonAdapter.createDefaultSerializerAdapter(), + endpoint, + instanceId, + serviceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new 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); + 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())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of DeviceManagementAsyncClient class. + * + * @return an instance of DeviceManagementAsyncClient. + */ + @Generated + public DeviceManagementAsyncClient buildAsyncClient() { + return new DeviceManagementAsyncClient(buildInnerClient().getDeviceManagements()); + } + + /** + * Builds an instance of DeviceManagementClient class. + * + * @return an instance of DeviceManagementClient. + */ + @Generated + public DeviceManagementClient buildClient() { + return new DeviceManagementClient(new DeviceManagementAsyncClient(buildInnerClient().getDeviceManagements())); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateAsyncClient.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateAsyncClient.java new file mode 100644 index 000000000000..4348bae0e1bc --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateAsyncClient.java @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.PollerFlux; +import com.azure.deviceupdate.deviceupdate.implementation.DeviceUpdatesImpl; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the asynchronous DeviceUpdateClient type. */ +@ServiceClient(builder = DeviceUpdateClientBuilder.class, isAsync = true) +public final class DeviceUpdateAsyncClient { + @Generated private final DeviceUpdatesImpl serviceClient; + + /** + * Initializes an instance of DeviceUpdateAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + DeviceUpdateAsyncClient(DeviceUpdatesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUpdates(RequestOptions requestOptions) { + return this.serviceClient.listUpdatesAsync(requestOptions); + } + + /** + * Import new update version. This is a long-running-operation; use Operation-Location response header value to + * check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> importUpdateWithResponse(BinaryData updateToImport, RequestOptions requestOptions) { + return this.serviceClient.importUpdateWithResponseAsync(updateToImport, requestOptions); + } + + /** + * Import new update version. This is a long-running-operation; use Operation-Location response header value to + * check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginImportUpdate( + BinaryData updateToImport, RequestOptions requestOptions) { + return this.serviceClient.beginImportUpdateAsync(updateToImport, requestOptions); + } + + /** + * Get a specific update version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     updateId: {
+     *         provider: String
+     *         name: String
+     *         version: String
+     *     }
+     *     description: String
+     *     friendlyName: String
+     *     isDeployable: Boolean
+     *     updateType: String
+     *     installedCriteria: String
+     *     compatibility: [
+     *         {
+     *             String: String
+     *         }
+     *     ]
+     *     instructions: {
+     *         steps: [
+     *             {
+     *                 type: String(Inline/Reference)
+     *                 description: String
+     *                 handler: String
+     *                 handlerProperties: Object
+     *                 files: [
+     *                     String
+     *                 ]
+     *                 updateId: (recursive schema, see updateId above)
+     *             }
+     *         ]
+     *     }
+     *     referencedBy: [
+     *         (recursive schema, see above)
+     *     ]
+     *     scanResult: String
+     *     manifestVersion: String
+     *     importedDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: 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 specific update version along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getUpdateWithResponse( + String provider, String name, String version, RequestOptions requestOptions) { + return this.serviceClient.getUpdateWithResponseAsync(provider, name, version, requestOptions); + } + + /** + * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value + * to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteUpdateWithResponse( + String provider, String name, String version, RequestOptions requestOptions) { + return this.serviceClient.deleteUpdateWithResponseAsync(provider, name, version, requestOptions); + } + + /** + * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value + * to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteUpdate( + String provider, String name, String version, RequestOptions requestOptions) { + return this.serviceClient.beginDeleteUpdateAsync(provider, name, version, requestOptions); + } + + /** + * Get a list of all update providers that have been imported to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersions(String provider, String name, RequestOptions requestOptions) { + return this.serviceClient.listVersionsAsync(provider, name, requestOptions); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update file identifiers for the specified version as paginated response with {@link + * PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listFiles( + String provider, String name, String version, RequestOptions requestOptions) { + return this.serviceClient.listFilesAsync(provider, name, version, requestOptions); + } + + /** + * Get a specific update file from the version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     fileName: String
+     *     sizeInBytes: long
+     *     hashes: {
+     *         String: String
+     *     }
+     *     mimeType: String
+     *     scanResult: String
+     *     scanDetails: String
+     *     properties: {
+     *         String: String
+     *     }
+     *     fileId: String
+     *     relatedFiles: [
+     *         {
+     *             fileName: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *             mimeType: String
+     *             scanResult: String
+     *             scanDetails: String
+     *             properties: {
+     *                 String: String
+     *             }
+     *         }
+     *     ]
+     *     downloadHandler: {
+     *         id: String
+     *     }
+     *     etag: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific update file from the version along with {@link Response} on successful completion of {@link + * Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponse( + String provider, String name, String version, String fileId, RequestOptions requestOptions) { + return this.serviceClient.getFileWithResponseAsync(provider, name, version, fileId, requestOptions); + } + + /** + * Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete + * operations are not returned by this API version. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 import update operations as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperations(RequestOptions requestOptions) { + return this.serviceClient.listOperationsAsync(requestOptions); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     resourceLocation: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return this.serviceClient.getOperationWithResponseAsync(operationId, requestOptions); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateClient.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateClient.java new file mode 100644 index 000000000000..d10da00d991e --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateClient.java @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; + +/** Initializes a new instance of the synchronous DeviceUpdateClient type. */ +@ServiceClient(builder = DeviceUpdateClientBuilder.class) +public final class DeviceUpdateClient { + @Generated private final DeviceUpdateAsyncClient client; + + /** + * Initializes an instance of DeviceUpdateClient class. + * + * @param client the async client. + */ + @Generated + DeviceUpdateClient(DeviceUpdateAsyncClient client) { + this.client = client; + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listUpdates(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listUpdates(requestOptions)); + } + + /** + * Import new update version. This is a long-running-operation; use Operation-Location response header value to + * check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginImportUpdate( + BinaryData updateToImport, RequestOptions requestOptions) { + return this.client.beginImportUpdate(updateToImport, requestOptions).getSyncPoller(); + } + + /** + * Get a specific update version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     updateId: {
+     *         provider: String
+     *         name: String
+     *         version: String
+     *     }
+     *     description: String
+     *     friendlyName: String
+     *     isDeployable: Boolean
+     *     updateType: String
+     *     installedCriteria: String
+     *     compatibility: [
+     *         {
+     *             String: String
+     *         }
+     *     ]
+     *     instructions: {
+     *         steps: [
+     *             {
+     *                 type: String(Inline/Reference)
+     *                 description: String
+     *                 handler: String
+     *                 handlerProperties: Object
+     *                 files: [
+     *                     String
+     *                 ]
+     *                 updateId: (recursive schema, see updateId above)
+     *             }
+     *         ]
+     *     }
+     *     referencedBy: [
+     *         (recursive schema, see above)
+     *     ]
+     *     scanResult: String
+     *     manifestVersion: String
+     *     importedDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: 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 specific update version along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateWithResponse( + String provider, String name, String version, RequestOptions requestOptions) { + return this.client.getUpdateWithResponse(provider, name, version, requestOptions).block(); + } + + /** + * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value + * to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteUpdate( + String provider, String name, String version, RequestOptions requestOptions) { + return this.client.beginDeleteUpdate(provider, name, version, requestOptions).getSyncPoller(); + } + + /** + * Get a list of all update providers that have been imported to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listVersions(provider, name, requestOptions)); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update file identifiers for the specified version as paginated response with {@link + * PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listFiles( + String provider, String name, String version, RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listFiles(provider, name, version, requestOptions)); + } + + /** + * Get a specific update file from the version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     fileName: String
+     *     sizeInBytes: long
+     *     hashes: {
+     *         String: String
+     *     }
+     *     mimeType: String
+     *     scanResult: String
+     *     scanDetails: String
+     *     properties: {
+     *         String: String
+     *     }
+     *     fileId: String
+     *     relatedFiles: [
+     *         {
+     *             fileName: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *             mimeType: String
+     *             scanResult: String
+     *             scanDetails: String
+     *             properties: {
+     *                 String: String
+     *             }
+     *         }
+     *     ]
+     *     downloadHandler: {
+     *         id: String
+     *     }
+     *     etag: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific update file from the version along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse( + String provider, String name, String version, String fileId, RequestOptions requestOptions) { + return this.client.getFileWithResponse(provider, name, version, fileId, requestOptions).block(); + } + + /** + * 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
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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 import update operations as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperations(RequestOptions requestOptions) { + return new PagedIterable<>(this.client.listOperations(requestOptions)); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     resourceLocation: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return operation metadata along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return this.client.getOperationWithResponse(operationId, requestOptions).block(); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateClientBuilder.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateClientBuilder.java new file mode 100644 index 000000000000..b0b2644dae33 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateClientBuilder.java @@ -0,0 +1,324 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.deviceupdate.deviceupdate.implementation.DeviceUpdateClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** A builder for creating a new instance of the DeviceUpdateClient type. */ +@ServiceClientBuilder(serviceClients = {DeviceUpdateClient.class, DeviceUpdateAsyncClient.class}) +public final class DeviceUpdateClientBuilder + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { + @Generated private static final String SDK_NAME = "name"; + + @Generated private static final String SDK_VERSION = "version"; + + @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://api.adu.microsoft.com/.default"}; + + @Generated + private final Map properties = + CoreUtils.getProperties("azure-deviceupdate-deviceupdate.properties"); + + @Generated private final List pipelinePolicies; + + /** Create an instance of the DeviceUpdateClientBuilder. */ + @Generated + public DeviceUpdateClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated private HttpPipeline pipeline; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated private HttpClient httpClient; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated private HttpLogOptions httpLogOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a + * request. + */ + @Generated private ClientOptions clientOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated private RetryOptions retryOptions; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service + * client. + */ + @Generated private Configuration configuration; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The TokenCredential used for authentication. + */ + @Generated private TokenCredential tokenCredential; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated private String endpoint; + + /** {@inheritDoc}. */ + @Generated + @Override + public DeviceUpdateClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Account instance identifier. + */ + @Generated private String instanceId; + + /** + * Sets Account instance identifier. + * + * @param instanceId the instanceId value. + * @return the DeviceUpdateClientBuilder. + */ + @Generated + public DeviceUpdateClientBuilder instanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + /* + * Service version + */ + @Generated private DeviceUpdateServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the DeviceUpdateClientBuilder. + */ + @Generated + public DeviceUpdateClientBuilder serviceVersion(DeviceUpdateServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if + * applicable. + */ + @Generated private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the DeviceUpdateClientBuilder. + */ + @Generated + public DeviceUpdateClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of DeviceUpdateClientImpl with the provided parameters. + * + * @return an instance of DeviceUpdateClientImpl. + */ + @Generated + private DeviceUpdateClientImpl buildInnerClient() { + if (pipeline == null) { + this.pipeline = createHttpPipeline(); + } + if (serviceVersion == null) { + this.serviceVersion = DeviceUpdateServiceVersion.getLatest(); + } + DeviceUpdateClientImpl client = + new DeviceUpdateClientImpl( + pipeline, + JacksonAdapter.createDefaultSerializerAdapter(), + endpoint, + instanceId, + serviceVersion); + return client; + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration = + (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + if (httpLogOptions == null) { + httpLogOptions = new HttpLogOptions(); + } + if (clientOptions == null) { + clientOptions = new 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); + 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())); + if (headers.getSize() > 0) { + policies.add(new AddHeadersPolicy(headers)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + policies.add(new CookiePolicy()); + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + policies.addAll( + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(clientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of DeviceUpdateAsyncClient class. + * + * @return an instance of DeviceUpdateAsyncClient. + */ + @Generated + public DeviceUpdateAsyncClient buildAsyncClient() { + return new DeviceUpdateAsyncClient(buildInnerClient().getDeviceUpdates()); + } + + /** + * Builds an instance of DeviceUpdateClient class. + * + * @return an instance of DeviceUpdateClient. + */ + @Generated + public DeviceUpdateClient buildClient() { + return new DeviceUpdateClient(new DeviceUpdateAsyncClient(buildInnerClient().getDeviceUpdates())); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateServiceVersion.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateServiceVersion.java new file mode 100644 index 000000000000..3b3680618872 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/DeviceUpdateServiceVersion.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +import com.azure.core.util.ServiceVersion; + +/** Service version of DeviceUpdateClient. */ +public enum DeviceUpdateServiceVersion implements ServiceVersion { + /** Enum value 2022-07-01-preview. */ + V2022_07_01_PREVIEW("2022-07-01-preview"); + + private final String version; + + DeviceUpdateServiceVersion(String version) { + this.version = version; + } + + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link DeviceUpdateServiceVersion}. + */ + public static DeviceUpdateServiceVersion getLatest() { + return V2022_07_01_PREVIEW; + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceManagementsImpl.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceManagementsImpl.java new file mode 100644 index 000000000000..6a3ef8b0568b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceManagementsImpl.java @@ -0,0 +1,9581 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DeviceManagements. */ +public final class DeviceManagementsImpl { + /** The proxy service used to perform REST calls. */ + private final DeviceManagementsService service; + + /** The service client containing this operation class. */ + private final DeviceUpdateClientImpl client; + + /** + * Initializes an instance of DeviceManagementsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeviceManagementsImpl(DeviceUpdateClientImpl client) { + this.service = + RestProxy.create( + DeviceManagementsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DeviceUpdateClientDeviceManagements to be used by the proxy service + * to perform REST calls. + */ + @Host("https://{endpoint}") + @ServiceInterface(name = "DeviceUpdateClientDe") + private interface DeviceManagementsService { + @Get("/deviceUpdate/{instanceId}/management/deviceClasses") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeviceClasses( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeviceClass( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Patch("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateDeviceClass( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/merge-patch+json") BinaryData deviceClassPatch, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDeviceClass( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/deviceClasses/{deviceClassId}/installableUpdates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listInstallableUpdatesForDeviceClass( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/devices") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDevices( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Post("/deviceUpdate/{instanceId}/management/devices:import") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> importDevices( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData importType, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDevice( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("deviceId") String deviceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/devices/{deviceId}/modules/{moduleId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeviceModule( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("deviceId") String deviceId, + @PathParam("moduleId") String moduleId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/updateCompliance") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getUpdateCompliance( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listGroups( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getGroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteGroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/updateCompliance") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getGroupUpdateCompliance( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/bestUpdates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listBestUpdatesForGroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeploymentsForGroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeployment( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deploymentId") String deploymentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Put("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateDeployment( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deploymentId") String deploymentId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData deployment, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDeployment( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deploymentId") String deploymentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deployments/{deploymentId}/status") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeploymentStatus( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deploymentId") String deploymentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeviceClassSubgroupsForGroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeviceClassSubgroupDetails( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}") + @ExpectedResponses({204}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDeviceClassSubgroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get( + "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/updateCompliance") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeviceClassSubgroupUpdateCompliance( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/bestUpdates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listBestUpdatesForDeviceClassSubgroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listDeploymentsForDeviceClassSubgroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get( + "/deviceUpdate/{instanceId}/management/groups/{groupId}/deviceClassSubgroups/{deviceClassId}/deployments/{deploymentId}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getDeploymentForDeviceClassSubgroup( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("groupId") String groupId, + @PathParam("deviceClassId") String deviceClassId, + @PathParam("deploymentId") String deploymentId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @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> deleteDeviceClassSubgroupDeployment( + @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}: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); + + @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}/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> listDevicesForDeviceClassSubgroupDeployment( + @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, 304}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOperation( + @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> listOperations( + @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> collectLogs( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData logCollectionRequest, + @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> getLogCollectionOperation( + @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/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> listLogCollectionOperations( + @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> getLogCollectionOperationDetailedStatus( + @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/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> listDeviceHealth( + @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) + 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) + 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) + 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) + 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) + 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) + 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) + Mono> listDevicesForDeviceClassSubgroupDeploymentNext( + @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> listOperationsNext( + @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> listLogCollectionOperationsNext( + @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 (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 device classes (unique combinations of device manufacturer and model) 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)); + } + + /** + * Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected 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 (unique combinations of device manufacturer and model) 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, Context context) { + final String accept = "application/json"; + return 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 (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeviceClassesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listDeviceClassesSinglePageAsync(requestOptions), + nextLink -> listDeviceClassesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected 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 (unique combinations of device manufacturer and model) 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, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listDeviceClassesSinglePageAsync(requestOptions, context), + nextLink -> listDeviceClassesNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices + * connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 device classes (unique combinations of device manufacturer and model) 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) { + return new PagedIterable<>(listDeviceClassesAsync(requestOptions)); + } + + /** + * Gets the properties of a device class. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @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
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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, Context context) { + final String accept = "application/json"; + return 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
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @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) { + return getDeviceClassWithResponseAsync(deviceClassId, requestOptions).block(); + } + + /** + * Update device class details. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     friendlyName: String
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @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
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @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. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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, Context context) { + final String accept = "application/json"; + return 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
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     friendlyName: String
+     *     deviceClassProperties: {
+     *         contractModel: {
+     *             id: String
+     *             name: String
+     *         }
+     *         compatProperties: {
+     *             String: String
+     *         }
+     *     }
+     *     bestCompatibleUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     * }
+     * }
+ * + * @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) { + return updateDeviceClassWithResponseAsync(deviceClassId, deviceClassPatch, requestOptions).block(); + } + + /** + * Deletes a device class. + * + * @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. + * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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, Context context) { + final String accept = "application/json"; + return service.deleteDeviceClass( + this.client.getEndpoint(), + this.client.getInstanceId(), + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Deletes a device class. + * + * @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. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @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) + public 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
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected 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) + public Mono> listInstallableUpdatesForDeviceClassSinglePageAsync( + String deviceClassId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return 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
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @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
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected 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, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listInstallableUpdatesForDeviceClassSinglePageAsync(deviceClassId, requestOptions, context), + nextLink -> + listInstallableUpdatesForDeviceClassNextSinglePageAsync( + nextLink, requestOptionsForNextPage, context)); + } + + /** + * Gets a list of installable updates for a device class. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @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) { + return new PagedIterable<>(listInstallableUpdatesForDeviceClassAsync(deviceClassId, requestOptions)); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 devices connected to Device Update for IoT Hub along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected 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) + public Mono> listDevicesSinglePageAsync(RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 devices connected to Device Update for IoT Hub as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDevicesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listDevicesSinglePageAsync(requestOptions), + nextLink -> listDevicesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Gets a list of devices connected to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of devices returned. You can filter on GroupId, DeviceClassId, or GroupId and DeploymentStatus.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected 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, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listDevicesSinglePageAsync(requestOptions, context), + nextLink -> listDevicesNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: 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 devices connected to Device Update for IoT Hub as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDevices(RequestOptions requestOptions) { + return new PagedIterable<>(listDevicesAsync(requestOptions)); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header + * value to check for operation status. + * + *

Request Body Schema + * + *

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

Request Body Schema + * + *

{@code
+     * String(Devices/Modules/All)
+     * }
+ * + * @param importType The types of devices to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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> importDevicesWithResponseAsync( + BinaryData importType, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.importDevices( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + importType, + accept, + requestOptions, + context); + } + + /** + * Import existing devices from IoT Hub. This is a long-running-operation; use Operation-Location response header + * value to check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * String(Devices/Modules/All)
+     * }
+ * + * @param importType The types of devices to import. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link 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 DefaultPollingStrategy<>( + this.client.getHttpPipeline(), + null, + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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, Context context) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.importDevicesWithResponseAsync(importType, requestOptions, context), + new DefaultPollingStrategy<>( + this.client.getHttpPipeline(), + null, + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * 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 this.beginImportDevicesAsync(importType, requestOptions).getSyncPoller(); + } + + /** + * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceWithResponseAsync(String deviceId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDevice( + this.client.getEndpoint(), + this.client.getInstanceId(), + deviceId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceWithResponseAsync( + String deviceId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getDevice( + this.client.getEndpoint(), + this.client.getInstanceId(), + deviceId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceWithResponse(String deviceId, RequestOptions requestOptions) { + return getDeviceWithResponseAsync(deviceId, requestOptions).block(); + } + + /** + * Gets the device module properties and latest deployment status for a device module connected to Device Update for + * IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param moduleId Device module identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device module properties and latest deployment status for a device module connected to Device Update + * for IoT Hub along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceModuleWithResponseAsync( + String deviceId, String moduleId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDeviceModule( + this.client.getEndpoint(), + this.client.getInstanceId(), + deviceId, + moduleId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets the device module properties and latest deployment status for a device module connected to Device Update for + * IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @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. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device module properties and latest deployment status for a device module connected to Device Update + * for IoT Hub along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceModuleWithResponseAsync( + String deviceId, String moduleId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getDeviceModule( + this.client.getEndpoint(), + this.client.getInstanceId(), + deviceId, + moduleId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets the device module properties and latest deployment status for a device module connected to Device Update for + * IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceId: String
+     *     moduleId: String
+     *     deviceClassId: String
+     *     groupId: String
+     *     lastAttemptedUpdate: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *     installedUpdate: (recursive schema, see installedUpdate above)
+     *     onLatestUpdate: boolean
+     *     lastDeploymentId: String
+     *     lastInstallResult: {
+     *         resultCode: int
+     *         extendedResultCode: int
+     *         resultDetails: String
+     *         stepResults: [
+     *             {
+     *                 update: (recursive schema, see update above)
+     *                 description: String
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+ * + * @param deviceId Device identifier in Azure IoT Hub. + * @param moduleId Device module identifier in Azure IoT Hub. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device module properties and latest deployment status for a device module connected to Device Update + * for IoT Hub along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceModuleWithResponse( + String deviceId, String moduleId, RequestOptions requestOptions) { + return getDeviceModuleWithResponseAsync(deviceId, moduleId, requestOptions).block(); + } + + /** + * Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress + * receiving new updates. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the breakdown of how many devices are on their latest update, have new updates available, or are in + * progress receiving new updates along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateComplianceWithResponse(RequestOptions requestOptions) { + return getUpdateComplianceWithResponseAsync(requestOptions).block(); + } + + /** + * 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 any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 device groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listGroupsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listGroups( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of all device groups. The $default group will always be returned first. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all device groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listGroupsSinglePageAsync(RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listGroups( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of all device groups. The $default group will always be returned first. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 device groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGroupsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listGroupsSinglePageAsync(requestOptions), + nextLink -> listGroupsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Gets a list of all device groups. The $default group will always be returned first. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of groups returned. You can order by any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all device groups as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGroupsAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listGroupsSinglePageAsync(requestOptions, context), + nextLink -> listGroupsNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * 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 any combination of groupId, device count, created date, subgroupsWithNewUpdatesAvailableCount, subgroupsWithUpdatesInProgressCount, or subgroupsOnLatestUpdateCount.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: 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 device groups as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroups(RequestOptions requestOptions) { + return new PagedIterable<>(listGroupsAsync(requestOptions)); + } + + /** + * Gets the device group properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     groupType: String(IoTHubTag/DefaultNoTag)
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     subgroupsWithNewUpdatesAvailableCount: Integer
+     *     subgroupsWithUpdatesInProgressCount: Integer
+     *     subgroupsWithOnLatestUpdateCount: Integer
+     *     deployments: [
+     *         String
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device group properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets the device group properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     groupType: String(IoTHubTag/DefaultNoTag)
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     subgroupsWithNewUpdatesAvailableCount: Integer
+     *     subgroupsWithUpdatesInProgressCount: Integer
+     *     subgroupsWithOnLatestUpdateCount: Integer
+     *     deployments: [
+     *         String
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the device group properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGroupWithResponseAsync( + String groupId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets the device group properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     groupType: String(IoTHubTag/DefaultNoTag)
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     subgroupsWithNewUpdatesAvailableCount: Integer
+     *     subgroupsWithUpdatesInProgressCount: Integer
+     *     subgroupsWithOnLatestUpdateCount: Integer
+     *     deployments: [
+     *         String
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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) { + return getGroupWithResponseAsync(groupId, requestOptions).block(); + } + + /** + * Deletes a device group. + * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteGroupWithResponseAsync(String groupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Deletes a device group. + * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteGroupWithResponseAsync( + String groupId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Deletes a device group. + * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteGroupWithResponse(String groupId, RequestOptions requestOptions) { + return deleteGroupWithResponseAsync(groupId, requestOptions).block(); + } + + /** + * 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
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device group update compliance information such as how many devices are on their latest update, how many + * need new updates, and how many are in progress on receiving a new update along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGroupUpdateComplianceWithResponseAsync( + String groupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getGroupUpdateCompliance( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get device group update compliance information such as how many devices are on their latest update, how many need + * new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device group update compliance information such as how many devices are on their latest update, how many + * need new updates, and how many are in progress on receiving a new update along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGroupUpdateComplianceWithResponseAsync( + String groupId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getGroupUpdateCompliance( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get device group update compliance information such as how many devices are on their latest update, how many need + * new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device group update compliance information such as how many devices are on their latest update, how many + * need new updates, and how many are in progress on receiving a new update along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGroupUpdateComplianceWithResponse(String groupId, RequestOptions requestOptions) { + return getGroupUpdateComplianceWithResponseAsync(groupId, requestOptions).block(); + } + + /** + * Get the best available updates for a device group and a count of how many devices need each update. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.
+ * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.
+ * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deviceCount: int
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deviceCount: int
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listBestUpdatesForGroupSinglePageAsync(groupId, requestOptions, context), + nextLink -> listBestUpdatesForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get the best available updates for a device group and a count of how many devices need each update. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.
+ * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForGroupSinglePageAsync( + String groupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDeploymentsForGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of deployments for a device group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device group along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForGroupSinglePageAsync( + String groupId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDeploymentsForGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of deployments for a device group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForGroupAsync(String groupId, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listDeploymentsForGroupSinglePageAsync(groupId, requestOptions), + nextLink -> listDeploymentsForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Gets a list of deployments for a device group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device group as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForGroupAsync( + String groupId, RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listDeploymentsForGroupSinglePageAsync(groupId, requestOptions, context), + nextLink -> listDeploymentsForGroupNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device group as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForGroup(String groupId, RequestOptions requestOptions) { + return new PagedIterable<>(listDeploymentsForGroupAsync(groupId, requestOptions)); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return getDeploymentWithResponseAsync(groupId, deploymentId, requestOptions).block(); + } + + /** + * Creates or updates a deployment. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param deployment The deployment properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateDeploymentWithResponseAsync( + String groupId, String deploymentId, BinaryData deployment, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.createOrUpdateDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + deployment, + accept, + requestOptions, + context)); + } + + /** + * Creates or updates a deployment. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param deployment The deployment properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateDeploymentWithResponseAsync( + String groupId, + String deploymentId, + BinaryData deployment, + RequestOptions requestOptions, + Context context) { + final String accept = "application/json"; + return service.createOrUpdateDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + deployment, + accept, + requestOptions, + context); + } + + /** + * Creates or updates a deployment. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @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 identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeploymentWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Deletes a deployment. + * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeploymentWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Deletes a deployment. + * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeploymentWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return deleteDeploymentWithResponseAsync(groupId, deploymentId, requestOptions).block(); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     subgroupStatus: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             deploymentState: String(Active/Failed/Inactive/Canceled)
+     *             error: (recursive schema, see error above)
+     *             totalDevices: Integer
+     *             devicesInProgressCount: Integer
+     *             devicesCompletedFailedCount: Integer
+     *             devicesCompletedSucceededCount: Integer
+     *             devicesCanceledCount: Integer
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentStatusWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDeploymentStatus( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     subgroupStatus: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             deploymentState: String(Active/Failed/Inactive/Canceled)
+     *             error: (recursive schema, see error above)
+     *             totalDevices: Integer
+     *             devicesInProgressCount: Integer
+     *             devicesCompletedFailedCount: Integer
+     *             devicesCompletedSucceededCount: Integer
+     *             devicesCanceledCount: Integer
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentStatusWithResponseAsync( + String groupId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getDeploymentStatus( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deploymentState: String(Active/ActiveWithSubgroupFailures/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     subgroupStatus: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             deploymentState: String(Active/Failed/Inactive/Canceled)
+     *             error: (recursive schema, see error above)
+     *             totalDevices: Integer
+     *             devicesInProgressCount: Integer
+     *             devicesCompletedFailedCount: Integer
+     *             devicesCompletedSucceededCount: Integer
+     *             devicesCanceledCount: Integer
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentStatusWithResponse( + String groupId, String deploymentId, RequestOptions requestOptions) { + return getDeploymentStatusWithResponseAsync(groupId, deploymentId, requestOptions).block(); + } + + /** + * Get the device class subgroups for the group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             groupId: String
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             deploymentId: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeviceClassSubgroupsForGroupWithResponseAsync( + String groupId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDeviceClassSubgroupsForGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get the device class subgroups for the group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             groupId: String
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             deploymentId: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeviceClassSubgroupsForGroupWithResponseAsync( + String groupId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDeviceClassSubgroupsForGroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get the device class subgroups for the group. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of device class subgroups returned. You can filter on compat properties by name and value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             groupId: String
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             deploymentId: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listDeviceClassSubgroupsForGroupWithResponse( + String groupId, RequestOptions requestOptions) { + return listDeviceClassSubgroupsForGroupWithResponseAsync(groupId, requestOptions).block(); + } + + /** + * Gets device class subgroup details. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     groupId: String
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     deploymentId: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupDetailsWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDeviceClassSubgroupDetails( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets device class subgroup details. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     groupId: String
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     deploymentId: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupDetailsWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getDeviceClassSubgroupDetails( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets device class subgroup details. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deviceClassId: String
+     *     groupId: String
+     *     createdDateTime: String
+     *     deviceCount: Integer
+     *     deploymentId: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceClassSubgroupDetailsWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return getDeviceClassSubgroupDetailsWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + } + + /** + * Deletes a device class subgroup. + * + * @param groupId Group identity. + * @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. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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, Context context) { + final String accept = "application/json"; + return service.deleteDeviceClassSubgroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Deletes a device class subgroup. + * + * @param groupId Group identity. + * @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) { + return deleteDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + } + + /** + * Get device class subgroup update compliance information such as how many devices are on their latest update, how + * many need new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup update compliance information such as how many devices are on their latest update, + * how many need new updates, and how many are in progress on receiving a new update along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupUpdateComplianceWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDeviceClassSubgroupUpdateCompliance( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get device class subgroup update compliance information such as how many devices are on their latest update, how + * many need new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return device class subgroup update compliance information such as how many devices are on their latest update, + * how many need new updates, and how many are in progress on receiving a new update along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupUpdateComplianceWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getDeviceClassSubgroupUpdateCompliance( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get device class subgroup update compliance information such as how many devices are on their latest update, how + * many need new updates, and how many are in progress on receiving a new update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     totalDeviceCount: int
+     *     onLatestUpdateDeviceCount: int
+     *     newUpdatesAvailableDeviceCount: int
+     *     updatesInProgressDeviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @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) { + return getDeviceClassSubgroupUpdateComplianceWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + } + + /** + * 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
+     *     deviceClassId: String
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the best available update for a device class subgroup and a count of how many devices need this update + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBestUpdatesForDeviceClassSubgroupWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listBestUpdatesForDeviceClassSubgroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get the best available update for a device class subgroup and a count of how many devices need this update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the best available update for a device class subgroup and a count of how many devices need this update + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBestUpdatesForDeviceClassSubgroupWithResponseAsync( + String groupId, String deviceClassId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listBestUpdatesForDeviceClassSubgroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get the best available update for a device class subgroup and a count of how many devices need this update. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     deviceCount: int
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the best available update for a device class subgroup and a count of how many devices need this update + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listBestUpdatesForDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return listBestUpdatesForDeviceClassSubgroupWithResponseAsync(groupId, deviceClassId, requestOptions).block(); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device class subgroup along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForDeviceClassSubgroupSinglePageAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDeploymentsForDeviceClassSubgroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device class subgroup along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForDeviceClassSubgroupSinglePageAsync( + String groupId, String deviceClassId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDeploymentsForDeviceClassSubgroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForDeviceClassSubgroupAsync( + String groupId, String deviceClassId, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listDeploymentsForDeviceClassSubgroupSinglePageAsync(groupId, deviceClassId, requestOptions), + nextLink -> + listDeploymentsForDeviceClassSubgroupNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Gets a list of deployments for a device class subgroup. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
orderbyStringNoOrders the set of deployments returned. You can order by start date.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeploymentsForDeviceClassSubgroupAsync( + String groupId, String deviceClassId, RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> + listDeploymentsForDeviceClassSubgroupSinglePageAsync( + groupId, deviceClassId, requestOptions, context), + nextLink -> + listDeploymentsForDeviceClassSubgroupNextSinglePageAsync( + nextLink, requestOptionsForNextPage, context)); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of deployments for a device class subgroup as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDeploymentsForDeviceClassSubgroup( + String groupId, String deviceClassId, RequestOptions requestOptions) { + return new PagedIterable<>(listDeploymentsForDeviceClassSubgroupAsync(groupId, deviceClassId, requestOptions)); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeploymentForDeviceClassSubgroupWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDeploymentForDeviceClassSubgroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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, Context context) { + final String accept = "application/json"; + return service.getDeploymentForDeviceClassSubgroup( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets the deployment properties. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the deployment properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeploymentForDeviceClassSubgroupWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return getDeploymentForDeviceClassSubgroupWithResponseAsync( + groupId, deviceClassId, deploymentId, requestOptions) + .block(); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDeviceClassSubgroupDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteDeviceClassSubgroupDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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> deleteDeviceClassSubgroupDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteDeviceClassSubgroupDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Deletes a device class subgroup deployment. + * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDeviceClassSubgroupDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return deleteDeviceClassSubgroupDeploymentWithResponseAsync( + groupId, deviceClassId, deploymentId, requestOptions) + .block(); + } + + /** + * Stops a deployment. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.stopDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Stops a deployment. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.stopDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Stops a deployment. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return stopDeploymentWithResponseAsync(groupId, deviceClassId, deploymentId, requestOptions).block(); + } + + /** + * Retries a deployment with failed devices. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> retryDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.retryDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Retries a deployment with failed devices. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> retryDeploymentWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.retryDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Retries a deployment with failed devices. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     deploymentId: String
+     *     startDateTime: OffsetDateTime
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     groupId: String
+     *     deviceClassSubgroups: [
+     *         String
+     *     ]
+     *     isCanceled: Boolean
+     *     isRetried: Boolean
+     *     rollbackPolicy: {
+     *         update: (recursive schema, see update above)
+     *         failure: {
+     *             devicesFailedPercentage: int
+     *             devicesFailedCount: int
+     *         }
+     *     }
+     *     isCloudInitiatedRollback: Boolean
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return deployment metadata along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response retryDeploymentWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return retryDeploymentWithResponseAsync(groupId, deviceClassId, deploymentId, requestOptions).block(); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     deploymentState: String(Active/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     totalDevices: Integer
+     *     devicesInProgressCount: Integer
+     *     devicesCompletedFailedCount: Integer
+     *     devicesCompletedSucceededCount: Integer
+     *     devicesCanceledCount: Integer
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupDeploymentStatusWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getDeviceClassSubgroupDeploymentStatus( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     deploymentState: String(Active/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     totalDevices: Integer
+     *     devicesInProgressCount: Integer
+     *     devicesCompletedFailedCount: Integer
+     *     devicesCompletedSucceededCount: Integer
+     *     devicesCanceledCount: Integer
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getDeviceClassSubgroupDeploymentStatusWithResponseAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getDeviceClassSubgroupDeploymentStatus( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     groupId: String
+     *     deviceClassId: String
+     *     deploymentState: String(Active/Failed/Inactive/Canceled)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     totalDevices: Integer
+     *     devicesInProgressCount: Integer
+     *     devicesCompletedFailedCount: Integer
+     *     devicesCompletedSucceededCount: Integer
+     *     devicesCanceledCount: Integer
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the status of a deployment including a breakdown of how many devices in the deployment are in progress, + * completed, or failed along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDeviceClassSubgroupDeploymentStatusWithResponse( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return getDeviceClassSubgroupDeploymentStatusWithResponseAsync( + groupId, deviceClassId, deploymentId, requestOptions) + .block(); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of devices in a deployment along with their state along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDevicesForDeviceClassSubgroupDeploymentSinglePageAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDevicesForDeviceClassSubgroupDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of devices in a deployment along with their state along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDevicesForDeviceClassSubgroupDeploymentSinglePageAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDevicesForDeviceClassSubgroupDeployment( + this.client.getEndpoint(), + this.client.getInstanceId(), + groupId, + deviceClassId, + deploymentId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of devices in a deployment along with their state as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDevicesForDeviceClassSubgroupDeploymentAsync( + 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<>( + () -> + listDevicesForDeviceClassSubgroupDeploymentSinglePageAsync( + groupId, deviceClassId, deploymentId, requestOptions), + nextLink -> + listDevicesForDeviceClassSubgroupDeploymentNextSinglePageAsync( + nextLink, requestOptionsForNextPage)); + } + + /** + * Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of devices in a deployment along with their state as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDevicesForDeviceClassSubgroupDeploymentAsync( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> + listDevicesForDeviceClassSubgroupDeploymentSinglePageAsync( + groupId, deviceClassId, deploymentId, requestOptions, context), + nextLink -> + listDevicesForDeviceClassSubgroupDeploymentNextSinglePageAsync( + nextLink, requestOptionsForNextPage, context)); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param groupId Group identity. + * @param deviceClassId Device class identifier. + * @param deploymentId Deployment identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of devices in a deployment along with their state as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listDevicesForDeviceClassSubgroupDeployment( + String groupId, String deviceClassId, String deploymentId, RequestOptions requestOptions) { + return new PagedIterable<>( + listDevicesForDeviceClassSubgroupDeploymentAsync(groupId, deviceClassId, deploymentId, requestOptions)); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @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> getOperationWithResponseAsync(String operationId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getOperation( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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> getOperationWithResponseAsync( + String operationId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getOperation( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @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 getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return getOperationWithResponseAsync(operationId, requestOptions).block(); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 device import operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listOperations( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all device import operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsSinglePageAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listOperations( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoRestricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"
topIntegerNoSpecifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 device import operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(requestOptions), + nextLink -> listOperationsNextSinglePageAsync(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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all device import operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationsAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(requestOptions, context), + nextLink -> listOperationsNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * 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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 device import operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperations(RequestOptions requestOptions) { + return new PagedIterable<>(listOperationsAsync(requestOptions)); + } + + /** + * Start the device diagnostics log collection operation on specified devices. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param logCollectionRequest 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 diagnostics request body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> collectLogsWithResponseAsync( + String operationId, BinaryData logCollectionRequest, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.collectLogs( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + logCollectionRequest, + accept, + requestOptions, + context)); + } + + /** + * Start the device diagnostics log collection operation on specified devices. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param logCollectionRequest The deployment properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return diagnostics request body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> collectLogsWithResponseAsync( + String operationId, BinaryData logCollectionRequest, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.collectLogs( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + logCollectionRequest, + accept, + requestOptions, + context); + } + + /** + * Start the device diagnostics log collection operation on specified devices. + * + *

Request Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param logCollectionRequest 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 diagnostics request body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response collectLogsWithResponse( + String operationId, BinaryData logCollectionRequest, RequestOptions requestOptions) { + return collectLogsWithResponseAsync(operationId, logCollectionRequest, requestOptions).block(); + } + + /** + * Get the device diagnostics log collection operation. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogCollectionOperationWithResponseAsync( + String operationId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getLogCollectionOperation( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get the device diagnostics log collection operation. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogCollectionOperationWithResponseAsync( + String operationId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getLogCollectionOperation( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get the device diagnostics log collection operation. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     deviceList: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *         }
+     *     ]
+     *     description: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogCollectionOperationWithResponse( + String operationId, RequestOptions requestOptions) { + return getLogCollectionOperationWithResponseAsync(operationId, requestOptions).block(); + } + + /** + * Get all device diagnostics log collection operations. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: 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 all device diagnostics log collection operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLogCollectionOperationsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listLogCollectionOperations( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all device diagnostics log collection operations. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 collection operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLogCollectionOperationsSinglePageAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listLogCollectionOperations( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get all device diagnostics log collection operations. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: 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 all device diagnostics log collection operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLogCollectionOperationsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listLogCollectionOperationsSinglePageAsync(requestOptions), + nextLink -> listLogCollectionOperationsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get all device diagnostics log collection operations. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 collection operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLogCollectionOperationsAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listLogCollectionOperationsSinglePageAsync(requestOptions, context), + nextLink -> + listLogCollectionOperationsNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get all device diagnostics log collection operations. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: 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 all device diagnostics log collection operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLogCollectionOperations(RequestOptions requestOptions) { + return new PagedIterable<>(listLogCollectionOperationsAsync(requestOptions)); + } + + /** + * Get device diagnostics log collection operation with detailed status. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     deviceStatus: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             resultCode: String
+     *             extendedResultCode: String
+     *             logLocation: String
+     *         }
+     *     ]
+     *     description: String
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation with detailed status along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogCollectionOperationDetailedStatusWithResponseAsync( + String operationId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getLogCollectionOperationDetailedStatus( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get device diagnostics log collection operation with detailed status. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     deviceStatus: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             resultCode: String
+     *             extendedResultCode: String
+     *             logLocation: String
+     *         }
+     *     ]
+     *     description: String
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 diagnostics log collection operation with detailed status along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getLogCollectionOperationDetailedStatusWithResponseAsync( + String operationId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getLogCollectionOperationDetailedStatus( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get device diagnostics log collection operation with detailed status. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     createdDateTime: String
+     *     lastActionDateTime: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     deviceStatus: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             resultCode: String
+     *             extendedResultCode: String
+     *             logLocation: String
+     *         }
+     *     ]
+     *     description: String
+     * }
+     * }
+ * + * @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 device diagnostics log collection operation with detailed status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getLogCollectionOperationDetailedStatusWithResponse( + String operationId, RequestOptions requestOptions) { + return getLogCollectionOperationDetailedStatusWithResponseAsync(operationId, requestOptions).block(); + } + + /** + * Get list of device health. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             state: String(healthy/unhealthy)
+     *             digitalTwinModelId: String
+     *             healthChecks: [
+     *                 {
+     *                     name: String
+     *                     result: String(success/userError)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param filter Filter list by specified 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 list of device health along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeviceHealthWithResponseAsync(String filter, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDeviceHealth( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + filter, + accept, + requestOptions, + context)); + } + + /** + * Get list of device health. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             state: String(healthy/unhealthy)
+     *             digitalTwinModelId: String
+     *             healthChecks: [
+     *                 {
+     *                     name: String
+     *                     result: String(success/userError)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param filter Filter list by specified properties. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeviceHealthWithResponseAsync( + String filter, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDeviceHealth( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + filter, + accept, + requestOptions, + context); + } + + /** + * Get list of device health. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             state: String(healthy/unhealthy)
+     *             digitalTwinModelId: String
+     *             healthChecks: [
+     *                 {
+     *                     name: String
+     *                     result: String(success/userError)
+     *                 }
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param filter Filter list by specified 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 list of device health along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listDeviceHealthWithResponse(String filter, RequestOptions requestOptions) { + return listDeviceHealthWithResponseAsync(filter, requestOptions).block(); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink 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) + public 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
+     * {
+     *     value: [
+     *         {
+     *             deviceClassId: String
+     *             friendlyName: String
+     *             deviceClassProperties: {
+     *                 contractModel: {
+     *                     id: String
+     *                     name: String
+     *                 }
+     *                 compatProperties: {
+     *                     String: String
+     *                 }
+     *             }
+     *             bestCompatibleUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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) + public Mono> listDeviceClassesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return 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
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of update information along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listInstallableUpdatesForDeviceClassNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listInstallableUpdatesForDeviceClassNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return list of update information along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listInstallableUpdatesForDeviceClassNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listInstallableUpdatesForDeviceClassNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of devices along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDevicesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDevicesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             deviceClassId: String
+     *             groupId: String
+     *             lastAttemptedUpdate: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deploymentStatus: String(Succeeded/InProgress/Canceled/Failed)
+     *             installedUpdate: (recursive schema, see installedUpdate above)
+     *             onLatestUpdate: boolean
+     *             lastDeploymentId: String
+     *             lastInstallResult: {
+     *                 resultCode: int
+     *                 extendedResultCode: int
+     *                 resultDetails: String
+     *                 stepResults: [
+     *                     {
+     *                         update: (recursive schema, see update above)
+     *                         description: String
+     *                         resultCode: int
+     *                         extendedResultCode: int
+     *                         resultDetails: String
+     *                     }
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of devices along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDevicesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDevicesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listGroupsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listGroupsNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             groupType: String(IoTHubTag/DefaultNoTag)
+     *             createdDateTime: String
+     *             deviceCount: Integer
+     *             subgroupsWithNewUpdatesAvailableCount: Integer
+     *             subgroupsWithUpdatesInProgressCount: Integer
+     *             subgroupsWithOnLatestUpdateCount: Integer
+     *             deployments: [
+     *                 String
+     *             ]
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of groups along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listGroupsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listGroupsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deviceCount: int
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of updatable devices for a device class subgroup along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBestUpdatesForGroupNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listBestUpdatesForGroupNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             groupId: String
+     *             deviceClassId: String
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             deviceCount: int
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of updatable devices for a device class subgroup along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listBestUpdatesForGroupNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listBestUpdatesForGroupNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForGroupNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDeploymentsForGroupNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForGroupNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDeploymentsForGroupNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForDeviceClassSubgroupNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDeploymentsForDeviceClassSubgroupNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deploymentId: String
+     *             startDateTime: OffsetDateTime
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             groupId: String
+     *             deviceClassSubgroups: [
+     *                 String
+     *             ]
+     *             isCanceled: Boolean
+     *             isRetried: Boolean
+     *             rollbackPolicy: {
+     *                 update: (recursive schema, see update above)
+     *                 failure: {
+     *                     devicesFailedPercentage: int
+     *                     devicesFailedCount: int
+     *                 }
+     *             }
+     *             isCloudInitiatedRollback: Boolean
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of deployments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDeploymentsForDeviceClassSubgroupNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDeploymentsForDeviceClassSubgroupNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of deployment device states along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDevicesForDeviceClassSubgroupDeploymentNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listDevicesForDeviceClassSubgroupDeploymentNext( + 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
+     * {
+     *     value: [
+     *         {
+     *             deviceId: String
+     *             moduleId: String
+     *             retryCount: int
+     *             movedOnToNewDeployment: boolean
+     *             deviceState: String(Succeeded/InProgress/Canceled/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of deployment device states along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listDevicesForDeviceClassSubgroupDeploymentNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listDevicesForDeviceClassSubgroupDeploymentNext( + 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
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of device operations with server paging support along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listOperationsNext( + 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
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of device operations with server paging support along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listOperationsNext(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
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink 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 diagnostics operations with server paging support along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLogCollectionOperationsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listLogCollectionOperationsNext( + 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
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             deviceList: [
+     *                 {
+     *                     deviceId: String
+     *                     moduleId: String
+     *                 }
+     *             ]
+     *             description: String
+     *             createdDateTime: String
+     *             lastActionDateTime: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 diagnostics operations with server paging support along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listLogCollectionOperationsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listLogCollectionOperationsNext( + 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)); + } + + private static final class TypeReferenceBinaryData extends TypeReference { + // empty + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceUpdateClientImpl.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceUpdateClientImpl.java new file mode 100644 index 000000000000..dca80df3cfe3 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceUpdateClientImpl.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.implementation; + +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateServiceVersion; + +/** Initializes a new instance of the DeviceUpdateClient type. */ +public final class DeviceUpdateClientImpl { + /** Account endpoint. */ + private final String endpoint; + + /** + * Gets Account endpoint. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Account instance identifier. */ + private final String instanceId; + + /** + * Gets Account instance identifier. + * + * @return the instanceId value. + */ + public String getInstanceId() { + return this.instanceId; + } + + /** Service version. */ + private final DeviceUpdateServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public DeviceUpdateServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The DeviceUpdatesImpl object to access its operations. */ + private final DeviceUpdatesImpl deviceUpdates; + + /** + * Gets the DeviceUpdatesImpl object to access its operations. + * + * @return the DeviceUpdatesImpl object. + */ + public DeviceUpdatesImpl getDeviceUpdates() { + return this.deviceUpdates; + } + + /** The DeviceManagementsImpl object to access its operations. */ + private final DeviceManagementsImpl deviceManagements; + + /** + * Gets the DeviceManagementsImpl object to access its operations. + * + * @return the DeviceManagementsImpl object. + */ + public DeviceManagementsImpl getDeviceManagements() { + return this.deviceManagements; + } + + /** + * Initializes an instance of DeviceUpdateClient client. + * + * @param endpoint Account endpoint. + * @param instanceId Account instance identifier. + * @param serviceVersion Service version. + */ + public DeviceUpdateClientImpl(String endpoint, String instanceId, DeviceUpdateServiceVersion serviceVersion) { + this( + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(), + JacksonAdapter.createDefaultSerializerAdapter(), + endpoint, + instanceId, + serviceVersion); + } + + /** + * Initializes an instance of DeviceUpdateClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Account endpoint. + * @param instanceId Account instance identifier. + * @param serviceVersion Service version. + */ + public DeviceUpdateClientImpl( + HttpPipeline httpPipeline, String endpoint, String instanceId, DeviceUpdateServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, instanceId, serviceVersion); + } + + /** + * Initializes an instance of DeviceUpdateClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Account endpoint. + * @param instanceId Account instance identifier. + * @param serviceVersion Service version. + */ + public DeviceUpdateClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + String endpoint, + String instanceId, + DeviceUpdateServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.instanceId = instanceId; + this.serviceVersion = serviceVersion; + this.deviceUpdates = new DeviceUpdatesImpl(this); + this.deviceManagements = new DeviceManagementsImpl(this); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceUpdatesImpl.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceUpdatesImpl.java new file mode 100644 index 000000000000..7075d4be5d35 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/DeviceUpdatesImpl.java @@ -0,0 +1,3782 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in DeviceUpdates. */ +public final class DeviceUpdatesImpl { + /** The proxy service used to perform REST calls. */ + private final DeviceUpdatesService service; + + /** The service client containing this operation class. */ + private final DeviceUpdateClientImpl client; + + /** + * Initializes an instance of DeviceUpdatesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DeviceUpdatesImpl(DeviceUpdateClientImpl client) { + this.service = + RestProxy.create(DeviceUpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for DeviceUpdateClientDeviceUpdates to be used by the proxy service to + * perform REST calls. + */ + @Host("https://{endpoint}") + @ServiceInterface(name = "DeviceUpdateClientDe") + private interface DeviceUpdatesService { + @Get("/deviceUpdate/{instanceId}/updates") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listUpdates( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Post("/deviceUpdate/{instanceId}/updates:import") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> importUpdate( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData updateToImport, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") + @ExpectedResponses({200, 304}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getUpdate( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("provider") String provider, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Delete("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}") + @ExpectedResponses({202}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteUpdate( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("provider") String provider, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/updates/providers") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listProviders( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNames( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("provider") String provider, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listVersions( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("provider") String provider, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listFiles( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("provider") String provider, + @PathParam("name") String name, + @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}") + @ExpectedResponses({200, 304}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getFile( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("provider") String provider, + @PathParam("name") String name, + @PathParam("version") String version, + @PathParam("fileId") String fileId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("/deviceUpdate/{instanceId}/updates/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> listOperations( + @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, 304}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOperation( + @HostParam("endpoint") String endpoint, + @PathParam(value = "instanceId", encoded = true) String instanceId, + @PathParam("operationId") String operationId, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listUpdatesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listProvidersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNamesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listVersionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType( + value = ClientAuthenticationException.class, + code = {401}) + @UnexpectedResponseExceptionType( + value = ResourceNotFoundException.class, + code = {404}) + @UnexpectedResponseExceptionType( + value = ResourceModifiedException.class, + code = {409}) + @UnexpectedResponseExceptionType(HttpResponseException.class) + 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) + Mono> listOperationsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, + RequestOptions requestOptions, + Context context); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 updates that have been imported to Device Update for IoT Hub along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listUpdatesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listUpdates( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all updates that have been imported to Device Update for IoT Hub along with {@link + * PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listUpdatesSinglePageAsync(RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listUpdates( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUpdatesAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listUpdatesSinglePageAsync(requestOptions), + nextLink -> listUpdatesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all updates that have been imported to Device Update for IoT Hub as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listUpdatesAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listUpdatesSinglePageAsync(requestOptions, context), + nextLink -> listUpdatesNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get a list of all updates that have been imported to Device Update for IoT Hub. + * + *

Query Parameters + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
searchStringNoRequest updates matching a free-text search expression.
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 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) { + return new PagedIterable<>(listUpdatesAsync(requestOptions)); + } + + /** + * Import new update version. This is a long-running-operation; use Operation-Location response header value to + * check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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> importUpdateWithResponseAsync( + BinaryData updateToImport, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.importUpdate( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + updateToImport, + accept, + requestOptions, + context)); + } + + /** + * Import new update version. This is a long-running-operation; use Operation-Location response header value to + * check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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> importUpdateWithResponseAsync( + BinaryData updateToImport, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.importUpdate( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + updateToImport, + accept, + requestOptions, + context); + } + + /** + * Import new update version. This is a long-running-operation; use Operation-Location response header value to + * check for operation status. + * + *

Request Body Schema + * + *

{@code
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 beginImportUpdateAsync( + BinaryData updateToImport, RequestOptions requestOptions) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.importUpdateWithResponseAsync(updateToImport, requestOptions), + new DefaultPollingStrategy<>( + this.client.getHttpPipeline(), + null, + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * 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
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 beginImportUpdateAsync( + BinaryData updateToImport, RequestOptions requestOptions, Context context) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.importUpdateWithResponseAsync(updateToImport, requestOptions, context), + new DefaultPollingStrategy<>( + this.client.getHttpPipeline(), + null, + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * 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
+     * [
+     *     {
+     *         importManifest: {
+     *             url: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *         }
+     *         friendlyName: String
+     *         files: [
+     *             {
+     *                 filename: String
+     *                 url: String
+     *             }
+     *         ]
+     *     }
+     * ]
+     * }
+ * + * @param updateToImport The update to be imported. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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 beginImportUpdate( + BinaryData updateToImport, RequestOptions requestOptions) { + return this.beginImportUpdateAsync(updateToImport, requestOptions).getSyncPoller(); + } + + /** + * Get a specific update version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     updateId: {
+     *         provider: String
+     *         name: String
+     *         version: String
+     *     }
+     *     description: String
+     *     friendlyName: String
+     *     isDeployable: Boolean
+     *     updateType: String
+     *     installedCriteria: String
+     *     compatibility: [
+     *         {
+     *             String: String
+     *         }
+     *     ]
+     *     instructions: {
+     *         steps: [
+     *             {
+     *                 type: String(Inline/Reference)
+     *                 description: String
+     *                 handler: String
+     *                 handlerProperties: Object
+     *                 files: [
+     *                     String
+     *                 ]
+     *                 updateId: (recursive schema, see updateId above)
+     *             }
+     *         ]
+     *     }
+     *     referencedBy: [
+     *         (recursive schema, see above)
+     *     ]
+     *     scanResult: String
+     *     manifestVersion: String
+     *     importedDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: 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 specific update version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getUpdateWithResponseAsync( + String provider, String name, String version, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getUpdate( + this.client.getEndpoint(), + this.client.getInstanceId(), + provider, + name, + version, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get a specific update version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     updateId: {
+     *         provider: String
+     *         name: String
+     *         version: String
+     *     }
+     *     description: String
+     *     friendlyName: String
+     *     isDeployable: Boolean
+     *     updateType: String
+     *     installedCriteria: String
+     *     compatibility: [
+     *         {
+     *             String: String
+     *         }
+     *     ]
+     *     instructions: {
+     *         steps: [
+     *             {
+     *                 type: String(Inline/Reference)
+     *                 description: String
+     *                 handler: String
+     *                 handlerProperties: Object
+     *                 files: [
+     *                     String
+     *                 ]
+     *                 updateId: (recursive schema, see updateId above)
+     *             }
+     *         ]
+     *     }
+     *     referencedBy: [
+     *         (recursive schema, see above)
+     *     ]
+     *     scanResult: String
+     *     manifestVersion: String
+     *     importedDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: 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. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific update version along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getUpdateWithResponseAsync( + String provider, String name, String version, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getUpdate( + this.client.getEndpoint(), + this.client.getInstanceId(), + provider, + name, + version, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get a specific update version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     updateId: {
+     *         provider: String
+     *         name: String
+     *         version: String
+     *     }
+     *     description: String
+     *     friendlyName: String
+     *     isDeployable: Boolean
+     *     updateType: String
+     *     installedCriteria: String
+     *     compatibility: [
+     *         {
+     *             String: String
+     *         }
+     *     ]
+     *     instructions: {
+     *         steps: [
+     *             {
+     *                 type: String(Inline/Reference)
+     *                 description: String
+     *                 handler: String
+     *                 handlerProperties: Object
+     *                 files: [
+     *                     String
+     *                 ]
+     *                 updateId: (recursive schema, see updateId above)
+     *             }
+     *         ]
+     *     }
+     *     referencedBy: [
+     *         (recursive schema, see above)
+     *     ]
+     *     scanResult: String
+     *     manifestVersion: String
+     *     importedDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: 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 specific update version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getUpdateWithResponse( + String provider, String name, String version, RequestOptions requestOptions) { + return getUpdateWithResponseAsync(provider, name, version, requestOptions).block(); + } + + /** + * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value + * to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteUpdateWithResponseAsync( + String provider, String name, String version, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.deleteUpdate( + this.client.getEndpoint(), + this.client.getInstanceId(), + provider, + name, + version, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value + * to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request 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> deleteUpdateWithResponseAsync( + String provider, String name, String version, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.deleteUpdate( + this.client.getEndpoint(), + this.client.getInstanceId(), + provider, + name, + version, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value + * to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteUpdateAsync( + String provider, String name, String version, RequestOptions requestOptions) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.deleteUpdateWithResponseAsync(provider, name, version, requestOptions), + new DefaultPollingStrategy<>( + this.client.getHttpPipeline(), + null, + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * 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. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginDeleteUpdateAsync( + String provider, String name, String version, RequestOptions requestOptions, Context context) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.deleteUpdateWithResponseAsync(provider, name, version, requestOptions, context), + new DefaultPollingStrategy<>( + this.client.getHttpPipeline(), + null, + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE), + new TypeReferenceBinaryData(), + new TypeReferenceBinaryData()); + } + + /** + * Delete a specific update version. This is a long-running-operation; use Operation-Location response header value + * to check for operation status. + * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginDeleteUpdate( + String provider, String name, String version, RequestOptions requestOptions) { + return this.beginDeleteUpdateAsync(provider, name, version, requestOptions).getSyncPoller(); + } + + /** + * Get a list of all update providers that have been imported to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update providers that have been imported to Device Update for IoT Hub as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProvidersAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listProvidersSinglePageAsync(requestOptions), + nextLink -> listProvidersNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update providers that have been imported to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update providers that have been imported to Device Update for IoT Hub as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listProvidersAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listProvidersSinglePageAsync(requestOptions, context), + nextLink -> listProvidersNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get a list of all update providers that have been imported to Device Update for IoT Hub. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update names that match the specified provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNamesAsync(String provider, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listNamesSinglePageAsync(provider, requestOptions), + nextLink -> listNamesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update names that match the specified provider. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update names that match the specified provider as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listNamesAsync(String provider, RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listNamesSinglePageAsync(provider, requestOptions, context), + nextLink -> listNamesNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get a list of all update names that match the specified provider. + * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

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

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersionsAsync(String provider, String name, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listVersionsSinglePageAsync(provider, name, requestOptions), + nextLink -> listVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update versions that match the specified provider and name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listVersionsAsync( + String provider, String name, RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listVersionsSinglePageAsync(provider, name, requestOptions, context), + nextLink -> listVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get a list of all update versions that match the specified provider and name. + * + *

Query Parameters + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoFilter updates by its properties.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update versions that match the specified provider and name as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) { + return new PagedIterable<>(listVersionsAsync(provider, name, requestOptions)); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + *

Response Body Schema + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: 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. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update file identifiers for the specified version along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listFilesSinglePageAsync( + String provider, String name, String version, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listFiles( + this.client.getEndpoint(), + this.client.getInstanceId(), + provider, + name, + version, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update file identifiers for the specified version as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listFilesAsync( + String provider, String name, String version, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listFilesSinglePageAsync(provider, name, version, requestOptions), + nextLink -> listFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: 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. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update file identifiers for the specified version as paginated response with {@link + * PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listFilesAsync( + String provider, String name, String version, RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listFilesSinglePageAsync(provider, name, version, requestOptions, context), + nextLink -> listFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * Get a list of all update file identifiers for the specified version. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all update file identifiers for the specified version as paginated response with {@link + * PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listFiles( + String provider, String name, String version, RequestOptions requestOptions) { + return new PagedIterable<>(listFilesAsync(provider, name, version, requestOptions)); + } + + /** + * Get a specific update file from the version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     fileName: String
+     *     sizeInBytes: long
+     *     hashes: {
+     *         String: String
+     *     }
+     *     mimeType: String
+     *     scanResult: String
+     *     scanDetails: String
+     *     properties: {
+     *         String: String
+     *     }
+     *     fileId: String
+     *     relatedFiles: [
+     *         {
+     *             fileName: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *             mimeType: String
+     *             scanResult: String
+     *             scanDetails: String
+     *             properties: {
+     *                 String: String
+     *             }
+     *         }
+     *     ]
+     *     downloadHandler: {
+     *         id: String
+     *     }
+     *     etag: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific update file from the version along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponseAsync( + String provider, String name, String version, String fileId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getFile( + this.client.getEndpoint(), + this.client.getInstanceId(), + provider, + name, + version, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Get a specific update file from the version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     fileName: String
+     *     sizeInBytes: long
+     *     hashes: {
+     *         String: String
+     *     }
+     *     mimeType: String
+     *     scanResult: String
+     *     scanDetails: String
+     *     properties: {
+     *         String: String
+     *     }
+     *     fileId: String
+     *     relatedFiles: [
+     *         {
+     *             fileName: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *             mimeType: String
+     *             scanResult: String
+     *             scanDetails: String
+     *             properties: {
+     *                 String: String
+     *             }
+     *         }
+     *     ]
+     *     downloadHandler: {
+     *         id: String
+     *     }
+     *     etag: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific update file from the version along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getFileWithResponseAsync( + String provider, + String name, + String version, + String fileId, + RequestOptions requestOptions, + Context context) { + final String accept = "application/json"; + return service.getFile( + this.client.getEndpoint(), + this.client.getInstanceId(), + provider, + name, + version, + fileId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Get a specific update file from the version. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     fileName: String
+     *     sizeInBytes: long
+     *     hashes: {
+     *         String: String
+     *     }
+     *     mimeType: String
+     *     scanResult: String
+     *     scanDetails: String
+     *     properties: {
+     *         String: String
+     *     }
+     *     fileId: String
+     *     relatedFiles: [
+     *         {
+     *             fileName: String
+     *             sizeInBytes: long
+     *             hashes: {
+     *                 String: String
+     *             }
+     *             mimeType: String
+     *             scanResult: String
+     *             scanDetails: String
+     *             properties: {
+     *                 String: String
+     *             }
+     *         }
+     *     ]
+     *     downloadHandler: {
+     *         id: String
+     *     }
+     *     etag: String
+     * }
+     * }
+ * + * @param provider Update provider. + * @param name Update name. + * @param version Update version. + * @param fileId File identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific update file from the version along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getFileWithResponse( + String provider, String name, String version, String fileId, RequestOptions requestOptions) { + return getFileWithResponseAsync(provider, name, version, fileId, requestOptions).block(); + } + + /** + * 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
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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 import update operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listOperations( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete + * operations are not returned by this API version. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all import update operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsSinglePageAsync( + RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listOperations( + this.client.getEndpoint(), + this.client.getInstanceId(), + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete + * operations are not returned by this API version. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 import update operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(requestOptions), + nextLink -> listOperationsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * Get a list of all import update operations. Completed operations are kept for 7 days before auto-deleted. Delete + * operations are not returned by this API version. + * + *

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

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of all import update operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOperationsAsync(RequestOptions requestOptions, Context context) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE); + return new PagedFlux<>( + () -> listOperationsSinglePageAsync(requestOptions, context), + nextLink -> listOperationsNextSinglePageAsync(nextLink, requestOptionsForNextPage, context)); + } + + /** + * 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
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.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: 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 import update operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOperations(RequestOptions requestOptions) { + return new PagedIterable<>(listOperationsAsync(requestOptions)); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     resourceLocation: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @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> getOperationWithResponseAsync(String operationId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getOperation( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context)); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     resourceLocation: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @param operationId Operation identifier. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the 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> getOperationWithResponseAsync( + String operationId, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.getOperation( + this.client.getEndpoint(), + this.client.getInstanceId(), + operationId, + this.client.getServiceVersion().getVersion(), + accept, + requestOptions, + context); + } + + /** + * Retrieve operation status. + * + *

Header Parameters + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
If-None-MatchStringNoDefines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.
+ * + *

Response Body Schema + * + *

{@code
+     * {
+     *     operationId: String
+     *     status: String(NotStarted/Running/Succeeded/Failed)
+     *     update: {
+     *         updateId: {
+     *             provider: String
+     *             name: String
+     *             version: String
+     *         }
+     *         description: String
+     *         friendlyName: String
+     *     }
+     *     resourceLocation: String
+     *     error: {
+     *         code: String
+     *         message: String
+     *         target: String
+     *         details: [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror: {
+     *             code: String
+     *             message: String
+     *             errorDetail: String
+     *             innerError: (recursive schema, see innerError above)
+     *         }
+     *         occurredDateTime: OffsetDateTime
+     *     }
+     *     traceId: String
+     *     lastActionDateTime: OffsetDateTime
+     *     createdDateTime: OffsetDateTime
+     *     etag: String
+     * }
+     * }
+ * + * @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 getOperationWithResponse(String operationId, RequestOptions requestOptions) { + return getOperationWithResponseAsync(operationId, requestOptions).block(); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listUpdatesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listUpdatesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             updateId: {
+     *                 provider: String
+     *                 name: String
+     *                 version: String
+     *             }
+     *             description: String
+     *             friendlyName: String
+     *             isDeployable: Boolean
+     *             updateType: String
+     *             installedCriteria: String
+     *             compatibility: [
+     *                 {
+     *                     String: String
+     *                 }
+     *             ]
+     *             instructions: {
+     *                 steps: [
+     *                     {
+     *                         type: String(Inline/Reference)
+     *                         description: String
+     *                         handler: String
+     *                         handlerProperties: Object
+     *                         files: [
+     *                             String
+     *                         ]
+     *                         updateId: (recursive schema, see updateId above)
+     *                     }
+     *                 ]
+     *             }
+     *             referencedBy: [
+     *                 (recursive schema, see above)
+     *             ]
+     *             scanResult: String
+     *             manifestVersion: String
+     *             importedDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of updates along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listUpdatesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listUpdatesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listProvidersNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listProvidersNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listProvidersNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listProvidersNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNamesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listNamesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listNamesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listNamesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listVersionsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listVersionsNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listVersionsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listFilesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listFilesNext( + nextLink, this.client.getEndpoint(), accept, requestOptions, context)) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         String
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of strings with server paging support along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listFilesNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listFilesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + getValues(res.getValue(), "value"), + getNextLink(res.getValue(), "nextLink"), + null)); + } + + /** + * Get the next page of items. + * + *

Response Body Schema + * + *

{@code
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of operations with server paging support along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.listOperationsNext( + 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
+     * {
+     *     value: [
+     *         {
+     *             operationId: String
+     *             status: String(NotStarted/Running/Succeeded/Failed)
+     *             update: {
+     *                 updateId: {
+     *                     provider: String
+     *                     name: String
+     *                     version: String
+     *                 }
+     *                 description: String
+     *                 friendlyName: String
+     *             }
+     *             resourceLocation: String
+     *             error: {
+     *                 code: String
+     *                 message: String
+     *                 target: String
+     *                 details: [
+     *                     (recursive schema, see above)
+     *                 ]
+     *                 innererror: {
+     *                     code: String
+     *                     message: String
+     *                     errorDetail: String
+     *                     innerError: (recursive schema, see innerError above)
+     *                 }
+     *                 occurredDateTime: OffsetDateTime
+     *             }
+     *             traceId: String
+     *             lastActionDateTime: OffsetDateTime
+     *             createdDateTime: OffsetDateTime
+     *             etag: String
+     *         }
+     *     ]
+     *     nextLink: String
+     * }
+     * }
+ * + * @param nextLink The nextLink parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @param context The context to associate with this operation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the list of operations with server paging support along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOperationsNextSinglePageAsync( + String nextLink, RequestOptions requestOptions, Context context) { + final String accept = "application/json"; + return service.listOperationsNext(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)); + } + + private static final class TypeReferenceBinaryData extends TypeReference { + // empty + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/package-info.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/package-info.java new file mode 100644 index 000000000000..ab4e87d9fe8b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the implementations for DeviceUpdateClient. Device Update for IoT Hub is an Azure service that + * enables customers to publish update for their IoT devices to the cloud, and then deploy that update to their devices + * (approve updates to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and + * reliability of the Windows Update platform, optimized for IoT devices. It works globally and knows when and how to + * update devices, enabling customers to focus on their business goals and let Device Update for IoT Hub handle the + * updates. + */ +package com.azure.deviceupdate.deviceupdate.implementation; diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/package-info.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/package-info.java new file mode 100644 index 000000000000..10ca4609cd08 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/com/azure/deviceupdate/deviceupdate/package-info.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * Package containing the classes for DeviceUpdateClient. Device Update for IoT Hub is an Azure service that enables + * customers to publish update for their IoT devices to the cloud, and then deploy that update to their devices (approve + * updates to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and reliability of + * the Windows Update platform, optimized for IoT devices. It works globally and knows when and how to update devices, + * enabling customers to focus on their business goals and let Device Update for IoT Hub handle the updates. + */ +package com.azure.deviceupdate.deviceupdate; diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/module-info.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/module-info.java new file mode 100644 index 000000000000..4a9fd45f2b97 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/java/module-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.deviceupdate.deviceupdate { + requires transitive com.azure.core; + + exports com.azure.deviceupdate.deviceupdate; +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/resources/azure-deviceupdate-deviceupdate.properties b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/resources/azure-deviceupdate-deviceupdate.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/main/resources/azure-deviceupdate-deviceupdate.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/ReadmeSamples.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/ReadmeSamples.java new file mode 100644 index 000000000000..3f0eeb9370b3 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/ReadmeSamples.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate; + +public final class ReadmeSamples { + public void readmeSamples() { + // BEGIN: com.azure.deviceupdate.deviceupdate.readme + // END: com.azure.deviceupdate.deviceupdate.readme + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java new file mode 100644 index 000000000000..e815282cda8b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCancelOrRetryDeployment.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementCancelOrRetryDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementstopdeployment.devicemanagementcancelorretrydeployment + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.stopDeploymentWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementstopdeployment.devicemanagementcancelorretrydeployment + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCollectLogs.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCollectLogs.java new file mode 100644 index 000000000000..3a3be2c4af86 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCollectLogs.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementCollectLogs { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementcollectlogs.devicemanagementcollectlogs + BinaryData logCollectionRequest = + BinaryData.fromString( + "{\"description\":\"Example diagnostics operation\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}]}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.collectLogsWithResponse( + "SampleOperationId", logCollectionRequest, requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementcollectlogs.devicemanagementcollectlogs + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java new file mode 100644 index 000000000000..6f289cc718d7 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCreateOrUpdateDeployment.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementCreateOrUpdateDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementcreateorupdatedeployment.devicemanagementcreateorupdatedeployment + BinaryData deployment = + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId\",\"groupId\":\"TestGroup\",\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.3\"}}},\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.createOrUpdateDeploymentWithResponse( + "TestGroup", "deploymentId", deployment, requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementcreateorupdatedeployment.devicemanagementcreateorupdatedeployment + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeployment.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeployment.java new file mode 100644 index 000000000000..f98768b2f79b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeployment.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementDeleteDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeployment.devicemanagementdeletedeployment + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.deleteDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeployment.devicemanagementdeletedeployment + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java new file mode 100644 index 000000000000..8aa40551d0bc --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClass.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementDeleteDeviceClass { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeviceclass.devicemanagementdeletedeviceclass + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.deleteDeviceClassWithResponse("deviceClass1", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeviceclass.devicemanagementdeletedeviceclass + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java new file mode 100644 index 000000000000..b61a8ef641cf --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroup.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementDeleteDeviceClassSubgroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeviceclasssubgroup.devicemanagementdeletedeviceclasssubgroup + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.deleteDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeviceclasssubgroup.devicemanagementdeletedeviceclasssubgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupDeployment.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupDeployment.java new file mode 100644 index 000000000000..d152496a5af5 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupDeployment.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementDeleteDeviceClassSubgroupDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeviceclasssubgroupdeployment.devicemanagementdeletedeviceclasssubgroupdeployment + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.deleteDeviceClassSubgroupDeploymentWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletedeviceclasssubgroupdeployment.devicemanagementdeletedeviceclasssubgroupdeployment + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteGroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteGroup.java new file mode 100644 index 000000000000..530307a93161 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteGroup.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementDeleteGroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletegroup.devicemanagementdeletegroup + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.deleteGroupWithResponse("group1", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementdeletegroup.devicemanagementdeletegroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeployment.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeployment.java new file mode 100644 index 000000000000..7b98a9e3b6a7 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeployment.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeployment.devicemanagementgetdeployment + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeployment.devicemanagementgetdeployment + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java new file mode 100644 index 000000000000..9d8fc5d629bb --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroup.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetDeploymentForDeviceClassSubgroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeploymentfordeviceclasssubgroup.devicemanagementgetdeploymentfordeviceclasssubgroup + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeploymentfordeviceclasssubgroup.devicemanagementgetdeploymentfordeviceclasssubgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java new file mode 100644 index 000000000000..9dd9677df8cc --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentStatus.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetDeploymentStatus { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeploymentstatus.devicemanagementgetdeploymentstatus + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeploymentStatusWithResponse("TestGroup", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeploymentstatus.devicemanagementgetdeploymentstatus + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDevice.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDevice.java new file mode 100644 index 000000000000..2bb255cbe271 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDevice.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetDevice { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdevice.devicemanagementgetdevice + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.getDeviceWithResponse("deviceId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdevice.devicemanagementgetdevice + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClass.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClass.java new file mode 100644 index 000000000000..708af41db066 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClass.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetDeviceClass { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeviceclass.devicemanagementgetdeviceclass + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeviceClassWithResponse("deviceClassId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeviceclass.devicemanagementgetdeviceclass + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java new file mode 100644 index 000000000000..ed0a8298aab5 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatus.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetDeviceClassSubgroupDeploymentStatus { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupdeploymentstatus.devicemanagementgetdeviceclasssubgroupdeploymentstatus + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupdeploymentstatus.devicemanagementgetdeviceclasssubgroupdeploymentstatus + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java new file mode 100644 index 000000000000..aef8945b7304 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateCompliance.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetDeviceClassSubgroupUpdateCompliance { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupupdatecompliance.devicemanagementgetdeviceclasssubgroupupdatecompliance + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeviceClassSubgroupUpdateComplianceWithResponse( + "group1", "deviceClassId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetdeviceclasssubgroupupdatecompliance.devicemanagementgetdeviceclasssubgroupupdatecompliance + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroup.java new file mode 100644 index 000000000000..8cac19fc1ea9 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroup.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetGroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetgroup.devicemanagementgetgroup + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.getGroupWithResponse("group1", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetgroup.devicemanagementgetgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java new file mode 100644 index 000000000000..4980bd5724ea --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupUpdateCompliance.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetGroupUpdateCompliance { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetgroupupdatecompliance.devicemanagementgetgroupupdatecompliance + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getGroupUpdateComplianceWithResponse("group1", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetgroupupdatecompliance.devicemanagementgetgroupupdatecompliance + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperation.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperation.java new file mode 100644 index 000000000000..2fd678ee80df --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperation.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetLogCollectionOperation { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetlogcollectionoperation.devicemanagementgetlogcollectionoperation + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getLogCollectionOperationWithResponse("SampleOperationId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetlogcollectionoperation.devicemanagementgetlogcollectionoperation + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationDetailedStatus.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationDetailedStatus.java new file mode 100644 index 000000000000..516f702cd13b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationDetailedStatus.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetLogCollectionOperationDetailedStatus { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetlogcollectionoperationdetailedstatus.devicemanagementgetlogcollectionoperationdetailedstatus + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getLogCollectionOperationDetailedStatusWithResponse( + "SampleOperationId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetlogcollectionoperationdetailedstatus.devicemanagementgetlogcollectionoperationdetailedstatus + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetOperation.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetOperation.java new file mode 100644 index 000000000000..a68572d3d365 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetOperation.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetOperation { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetoperation.devicemanagementgetoperation + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getOperationWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetoperation.devicemanagementgetoperation + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java new file mode 100644 index 000000000000..068c64c42afe --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetUpdateCompliance.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementGetUpdateCompliance { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetupdatecompliance.devicemanagementgetupdatecompliance + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.getUpdateComplianceWithResponse(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementgetupdatecompliance.devicemanagementgetupdatecompliance + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementImportDevices.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementImportDevices.java new file mode 100644 index 000000000000..d34561a90780 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementImportDevices.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementImportDevices { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementimportdevices.devicemanagementimportdevices + BinaryData importType = BinaryData.fromString("\"All\""); + RequestOptions requestOptions = new RequestOptions(); + SyncPoller response = + deviceManagementClient.beginImportDevices(importType, requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementimportdevices.devicemanagementimportdevices + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java new file mode 100644 index 000000000000..dc76cfae5174 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroup.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListBestUpdatesForDeviceClassSubgroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistbestupdatesfordeviceclasssubgroup.devicemanagementlistbestupdatesfordeviceclasssubgroup + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.listBestUpdatesForDeviceClassSubgroupWithResponse( + "group1", "deviceClassId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistbestupdatesfordeviceclasssubgroup.devicemanagementlistbestupdatesfordeviceclasssubgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java new file mode 100644 index 000000000000..4be9eb7a0d46 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForGroup.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListBestUpdatesForGroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistbestupdatesforgroup.devicemanagementlistbestupdatesforgroup + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listBestUpdatesForGroup("group1", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistbestupdatesforgroup.devicemanagementlistbestupdatesforgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java new file mode 100644 index 000000000000..467452152d5a --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroup.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListDeploymentsForDeviceClassSubgroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeploymentsfordeviceclasssubgroup.devicemanagementlistdeploymentsfordeviceclasssubgroup + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listDeploymentsForDeviceClassSubgroup( + "TestGroup", "deviceClassId1", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeploymentsfordeviceclasssubgroup.devicemanagementlistdeploymentsfordeviceclasssubgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java new file mode 100644 index 000000000000..6c63a946822b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForGroup.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListDeploymentsForGroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeploymentsforgroup.devicemanagementlistdeploymentsforgroup + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listDeploymentsForGroup("TestGroup", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeploymentsforgroup.devicemanagementlistdeploymentsforgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java new file mode 100644 index 000000000000..5a7ed4a05e3c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroup.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListDeviceClassSubgroupsForGroup { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeviceclasssubgroupsforgroup.devicemanagementlistdeviceclasssubgroupsforgroup + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.listDeviceClassSubgroupsForGroupWithResponse("group1", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeviceclasssubgroupsforgroup.devicemanagementlistdeviceclasssubgroupsforgroup + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClasses.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClasses.java new file mode 100644 index 000000000000..f047b2f4b24a --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClasses.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListDeviceClasses { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeviceclasses.devicemanagementlistdeviceclasses + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listDeviceClasses(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdeviceclasses.devicemanagementlistdeviceclasses + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceHealth.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceHealth.java new file mode 100644 index 000000000000..bca6ab9d6b13 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceHealth.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListDeviceHealth { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdevicehealth.devicemanagementlistdevicehealth + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.listDeviceHealthWithResponse("state eq 'unhealthy'", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdevicehealth.devicemanagementlistdevicehealth + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevices.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevices.java new file mode 100644 index 000000000000..82aa348aeb99 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevices.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListDevices { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdevices.devicemanagementlistdevices + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listDevices(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdevices.devicemanagementlistdevices + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesForDeviceClassSubgroupDeployment.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesForDeviceClassSubgroupDeployment.java new file mode 100644 index 000000000000..aae81d1ed3ab --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesForDeviceClassSubgroupDeployment.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListDevicesForDeviceClassSubgroupDeployment { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdevicesfordeviceclasssubgroupdeployment.devicemanagementlistdevicesfordeviceclasssubgroupdeployment + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listDevicesForDeviceClassSubgroupDeployment( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistdevicesfordeviceclasssubgroupdeployment.devicemanagementlistdevicesfordeviceclasssubgroupdeployment + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListGroups.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListGroups.java new file mode 100644 index 000000000000..d01eb03cc7c6 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListGroups.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListGroups { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistgroups.devicemanagementlistgroups + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listGroups(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistgroups.devicemanagementlistgroups + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java new file mode 100644 index 000000000000..7e45c907a838 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClass.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListInstallableUpdatesForDeviceClass { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistinstallableupdatesfordeviceclass.devicemanagementlistinstallableupdatesfordeviceclass + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listInstallableUpdatesForDeviceClass("deviceClassId", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistinstallableupdatesfordeviceclass.devicemanagementlistinstallableupdatesfordeviceclass + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListLogCollectionOperations.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListLogCollectionOperations.java new file mode 100644 index 000000000000..5293b5d1d662 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListLogCollectionOperations.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListLogCollectionOperations { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistlogcollectionoperations.devicemanagementlistlogcollectionoperations + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listLogCollectionOperations(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistlogcollectionoperations.devicemanagementlistlogcollectionoperations + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListOperations.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListOperations.java new file mode 100644 index 000000000000..33a22935651e --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListOperations.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementListOperations { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistoperations.devicemanagementlistoperations + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listOperations(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementlistoperations.devicemanagementlistoperations + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java new file mode 100644 index 000000000000..cd38087563eb --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementUpdateDeviceClass.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceManagementUpdateDeviceClass { + public static void main(String[] args) { + DeviceManagementClient deviceManagementClient = + new DeviceManagementClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.devicemanagementupdatedeviceclass.devicemanagementupdatedeviceclass + BinaryData deviceClassPatch = BinaryData.fromString("{\"friendlyName\":\"GA Webcams\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.updateDeviceClassWithResponse("deviceClassId", deviceClassPatch, requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.devicemanagementupdatedeviceclass.devicemanagementupdatedeviceclass + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateDeleteUpdate.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateDeleteUpdate.java new file mode 100644 index 000000000000..a72ac707b755 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateDeleteUpdate.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateDeleteUpdate { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdatedeleteupdate.deviceupdatedeleteupdate + RequestOptions requestOptions = new RequestOptions(); + SyncPoller response = + deviceUpdateClient.beginDeleteUpdate("microsoft", "adu", "1.0.0.0", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdatedeleteupdate.deviceupdatedeleteupdate + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetFile.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetFile.java new file mode 100644 index 000000000000..7f5061790d47 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetFile.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateGetFile { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdategetfile.deviceupdategetfile + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceUpdateClient.getFileWithResponse("microsoft", "adu", "1.0.0.0", "abc123", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdategetfile.deviceupdategetfile + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetOperation.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetOperation.java new file mode 100644 index 000000000000..8fa120764bb8 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetOperation.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateGetOperation { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdategetoperation.deviceupdategetoperation + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceUpdateClient.getOperationWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdategetoperation.deviceupdategetoperation + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetUpdate.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetUpdate.java new file mode 100644 index 000000000000..5e0bf636afc1 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetUpdate.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateGetUpdate { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdategetupdate.deviceupdategetupdate + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceUpdateClient.getUpdateWithResponse("microsoft", "adu", "1.0.0.0", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdategetupdate.deviceupdategetupdate + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateImportUpdate.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateImportUpdate.java new file mode 100644 index 000000000000..a01af368ba8c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateImportUpdate.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.SyncPoller; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateImportUpdate { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdateimportupdate.deviceupdateimportupdate + BinaryData updateToImport = + BinaryData.fromString( + "[{\"files\":[{\"filename\":\"file1.bin\",\"url\":\"http://test.blob.core.windows.net/test/upload1v5uww1q\"},{\"filename\":\"file2.bin\",\"url\":\"http://test.blob.core.windows.net/test/uploadkrmn5yw0\"},{\"filename\":\"file3.bin\",\"url\":\"http://test.blob.core.windows.net/test/uploaddq52ky5m\"}],\"importManifest\":{\"hashes\":{\"sha256\":\"O19LyyncPe1AGstOdkcmozLV8pSbBdqrE18HdYVohRc=\"},\"sizeInBytes\":816,\"url\":\"http://test.blob.core.windows.net/test/uploadimportMan.json\"}}]"); + RequestOptions requestOptions = new RequestOptions(); + SyncPoller response = + deviceUpdateClient.beginImportUpdate(updateToImport, requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdateimportupdate.deviceupdateimportupdate + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListFiles.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListFiles.java new file mode 100644 index 000000000000..6a0cde5659e8 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListFiles.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateListFiles { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistfiles.deviceupdatelistfiles + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceUpdateClient.listFiles("microsoft", "adu", "1.0.0.0", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistfiles.deviceupdatelistfiles + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListNames.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListNames.java new file mode 100644 index 000000000000..4e56ab44c6c0 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListNames.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateListNames { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistnames.deviceupdatelistnames + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listNames("microsoft", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistnames.deviceupdatelistnames + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListOperations.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListOperations.java new file mode 100644 index 000000000000..8cce49db139c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListOperations.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateListOperations { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistoperations.deviceupdatelistoperations + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listOperations(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistoperations.deviceupdatelistoperations + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListProviders.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListProviders.java new file mode 100644 index 000000000000..4e2597d04b31 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListProviders.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateListProviders { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistproviders.deviceupdatelistproviders + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listProviders(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistproviders.deviceupdatelistproviders + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListUpdates.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListUpdates.java new file mode 100644 index 000000000000..975d2321b79c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListUpdates.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateListUpdates { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistupdates.deviceupdatelistupdates + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listUpdates(requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistupdates.deviceupdatelistupdates + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListVersions.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListVersions.java new file mode 100644 index 000000000000..1028a494f444 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/samples/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListVersions.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; + +public class DeviceUpdateListVersions { + public static void main(String[] args) { + DeviceUpdateClient deviceUpdateClient = + new DeviceUpdateClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint("contoso.api.adu.microsoft.com") + .instanceId("blue") + .buildClient(); + // BEGIN:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistversions.deviceupdatelistversions + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listVersions("microsoft", "adu", requestOptions); + // END:com.azure.deviceupdate.deviceupdate.generated.deviceupdatelistversions.deviceupdatelistversions + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCancelOrRetryDeploymentTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCancelOrRetryDeploymentTests.java new file mode 100644 index 000000000000..bb16ddd871c0 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCancelOrRetryDeploymentTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementCancelOrRetryDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementCancelOrRetryDeploymentTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.stopDeploymentWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId\",\"groupId\":\"TestGroup\",\"isCanceled\":true,\"isRetried\":false,\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCollectLogsTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCollectLogsTests.java new file mode 100644 index 000000000000..520bd104cc71 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCollectLogsTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementCollectLogsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementCollectLogsTests() { + BinaryData logCollectionRequest = + BinaryData.fromString( + "{\"description\":\"Example diagnostics operation\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}]}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.collectLogsWithResponse( + "SampleOperationId", logCollectionRequest, requestOptions); + Assertions.assertEquals(201, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"SampleOperationId\",\"description\":\"Example diagnostics operation\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java new file mode 100644 index 000000000000..31660e80c403 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementCreateOrUpdateDeploymentTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementCreateOrUpdateDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementCreateOrUpdateDeploymentTests() { + BinaryData deployment = + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId\",\"groupId\":\"TestGroup\",\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.3\"}}},\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.createOrUpdateDeploymentWithResponse( + "TestGroup", "deploymentId", deployment, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId\",\"deviceClassSubgroups\":[\"deviceClassId1\",\"deviceClassId2\"],\"groupId\":\"TestGroup\",\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.3\"}}},\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java new file mode 100644 index 000000000000..2405b35e2f44 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeploymentTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementDeleteDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeploymentTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.deleteDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupDeploymentTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupDeploymentTests.java new file mode 100644 index 000000000000..9236ffb2ca9b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupDeploymentTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementDeleteDeviceClassSubgroupDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeviceClassSubgroupDeploymentTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.deleteDeviceClassSubgroupDeploymentWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..53b1f60c475c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassSubgroupTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementDeleteDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeviceClassSubgroupTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.deleteDeviceClassSubgroupWithResponse("group1", "deviceClassId", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java new file mode 100644 index 000000000000..3d654426582f --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteDeviceClassTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementDeleteDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteDeviceClassTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.deleteDeviceClassWithResponse("deviceClass1", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteGroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteGroupTests.java new file mode 100644 index 000000000000..1fe95ef4e453 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementDeleteGroupTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementDeleteGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementDeleteGroupTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.deleteGroupWithResponse("group1", requestOptions); + Assertions.assertEquals(204, response.getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..5208ccedc9b6 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentForDeviceClassSubgroupTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetDeploymentForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeploymentForDeviceClassSubgroupTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeploymentForDeviceClassSubgroupWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId\",\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.3\"}}},\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java new file mode 100644 index 000000000000..2714d4f38339 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentStatusTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetDeploymentStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeploymentStatusTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeploymentStatusWithResponse("TestGroup", "deploymentId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentState\":\"ActiveWithSubgroupFailures\",\"groupId\":\"TestGroup\",\"subgroupStatus\":[{\"deploymentState\":\"Active\",\"deviceClassId\":\"deviceClassId1\",\"devicesCanceledCount\":0,\"devicesCompletedFailedCount\":0,\"devicesCompletedSucceededCount\":1,\"devicesInProgressCount\":0,\"groupId\":\"TestGroup\",\"totalDevices\":1},{\"deploymentState\":\"Failed\",\"deviceClassId\":\"deviceClassId2\",\"devicesCanceledCount\":0,\"devicesCompletedFailedCount\":1,\"devicesCompletedSucceededCount\":1,\"devicesInProgressCount\":0,\"error\":{\"code\":\"ADMConfigurationLimitExceeded\",\"message\":\"The subgroup deployment failed to be created due to hitting the ADM configuration limit\"},\"groupId\":\"TestGroup\",\"totalDevices\":2}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentTests.java new file mode 100644 index 000000000000..7081bca34f56 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeploymentTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeploymentTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeploymentWithResponse("TestGroup", "deploymentId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId\",\"deviceClassSubgroups\":[\"deviceClassId1\",\"deviceClassId2\"],\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"description\":\"This update fixes a security issue.\",\"friendlyName\":\"Contoso Toaster v1.2.3.3\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.3\"}}},\"startDateTime\":\"2020-04-22T12:12:12.0000000+00:00\",\"update\":{\"description\":\"This update fixes a security issue.\",\"friendlyName\":\"Contoso Toaster v1.2.3.4\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java new file mode 100644 index 000000000000..e73c8d76853d --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetDeviceClassSubgroupDeploymentStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceClassSubgroupDeploymentStatusTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeviceClassSubgroupDeploymentStatusWithResponse( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentState\":\"Active\",\"deviceClassId\":\"deviceClassId\",\"devicesCanceledCount\":0,\"devicesCompletedFailedCount\":0,\"devicesCompletedSucceededCount\":1,\"devicesInProgressCount\":0,\"groupId\":\"TestGroup\",\"totalDevices\":1}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java new file mode 100644 index 000000000000..fc17decd4ae4 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetDeviceClassSubgroupUpdateComplianceTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceClassSubgroupUpdateComplianceTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeviceClassSubgroupUpdateComplianceWithResponse( + "group1", "deviceClassId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"newUpdatesAvailableDeviceCount\":36265,\"onLatestUpdateDeviceCount\":256873,\"totalDeviceCount\":302204,\"updatesInProgressDeviceCount\":9066}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java new file mode 100644 index 000000000000..237e0802b4b1 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceClassTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceClassTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getDeviceClassWithResponse("deviceClassId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"bestCompatibleUpdate\":{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.0.0.0\"}},\"deviceClassId\":\"deviceClassId\",\"deviceClassProperties\":{\"compatProperties\":{\"manufacturer\":\"manufacturer1\",\"model\":\"model1\"},\"contractModel\":{\"name\":\"Device Update Model V2\",\"id\":\"dtmi:azure:iot:deviceUpdateContractModel;2\"}},\"friendlyName\":\"DeviceClass2020-04-22T12:12:12.0000000+00:00\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceTests.java new file mode 100644 index 000000000000..2aa75104de4e --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetDeviceTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetDeviceTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetDeviceTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.getDeviceWithResponse("deviceId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentStatus\":\"Failed\",\"deviceClassId\":\"deviceClass1\",\"deviceId\":\"device1\",\"installedUpdate\":{\"description\":\"Fixes security issue.\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}},\"lastAttemptedUpdate\":{\"description\":\"Fixes performance issue.\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"2.0.0.0\"}},\"lastInstallResult\":{\"extendedResultCode\":0,\"resultCode\":200,\"resultDetails\":\"\",\"stepResults\":[{\"extendedResultCode\":0,\"resultCode\":200,\"resultDetails\":\"\",\"update\":{\"friendlyName\":\"Microsoft Peripheral Camera 1.0\",\"updateId\":{\"name\":\"peripheralcamera\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}},{\"extendedResultCode\":0,\"resultCode\":200,\"resultDetails\":\"\",\"update\":{\"friendlyName\":\"Microsoft Peripheral Speaker 1.0\",\"updateId\":{\"name\":\"peripheralspeaker\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}}]},\"onLatestUpdate\":false}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupTests.java new file mode 100644 index 000000000000..167f658d8fb3 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetGroupTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.getGroupWithResponse("group1", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deviceCount\":149,\"groupId\":\"MyGroup\",\"groupType\":\"IoTHubTag\",\"subgroupsWithNewUpdatesAvailableCount\":3,\"subgroupsWithOnLatestUpdateCount\":1,\"subgroupsWithUpdatesInProgressCount\":0}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupUpdateComplianceTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupUpdateComplianceTests.java new file mode 100644 index 000000000000..03fc78b82e78 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetGroupUpdateComplianceTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetGroupUpdateComplianceTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetGroupUpdateComplianceTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getGroupUpdateComplianceWithResponse("group1", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"newUpdatesAvailableDeviceCount\":36265,\"onLatestUpdateDeviceCount\":256873,\"totalDeviceCount\":302204,\"updatesInProgressDeviceCount\":9066}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationDetailedStatusTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationDetailedStatusTests.java new file mode 100644 index 000000000000..d2fe3dddff8d --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationDetailedStatusTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetLogCollectionOperationDetailedStatusTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetLogCollectionOperationDetailedStatusTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getLogCollectionOperationDetailedStatusWithResponse( + "SampleOperationId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"SampleOperationId\",\"description\":\"operation description\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceStatus\":[{\"deviceId\":\"DeviceA\",\"extendedResultCode\":\"0\",\"logLocation\":\"/storageAccount/deviceUpdateInstanceName/DeviceA/SampleOperationId\",\"resultCode\":\"200\",\"status\":\"NotStarted\"},{\"deviceId\":\"DeviceB\",\"extendedResultCode\":\"0\",\"logLocation\":\"/storageAccount/deviceUpdateInstanceName/DeviceB/ModuleB/SampleOperationId\",\"moduleId\":\"ModuleB\",\"resultCode\":\"200\",\"status\":\"NotStarted\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationTests.java new file mode 100644 index 000000000000..f948dfd3bb32 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetLogCollectionOperationTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetLogCollectionOperationTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetLogCollectionOperationTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getLogCollectionOperationWithResponse("SampleOperationId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"SampleOperationId\",\"description\":\"Example diagnostics operation\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetOperationTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetOperationTests.java new file mode 100644 index 000000000000..c254adf2ecd2 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetOperationTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetOperationTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetOperationTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.getOperationWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\"}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java new file mode 100644 index 000000000000..8200505b50a1 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementGetUpdateComplianceTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementGetUpdateComplianceTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementGetUpdateComplianceTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = deviceManagementClient.getUpdateComplianceWithResponse(requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"newUpdatesAvailableDeviceCount\":36265,\"onLatestUpdateDeviceCount\":256873,\"totalDeviceCount\":302204,\"updatesInProgressDeviceCount\":9066}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementImportDevicesTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementImportDevicesTests.java new file mode 100644 index 000000000000..016a94548f6e --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementImportDevicesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementImportDevicesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementImportDevicesTests() { + BinaryData importType = BinaryData.fromString("\"All\""); + RequestOptions requestOptions = new RequestOptions(); + SyncPoller response = + deviceManagementClient.beginImportDevices(importType, requestOptions); + Assertions.assertEquals( + LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..f497b9633658 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForDeviceClassSubgroupTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListBestUpdatesForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListBestUpdatesForDeviceClassSubgroupTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.listBestUpdatesForDeviceClassSubgroupWithResponse( + "group1", "deviceClassId", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deviceClassId\":\"deviceClassId\",\"deviceCount\":100,\"groupId\":\"group1\",\"update\":{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.0.0.0\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java new file mode 100644 index 000000000000..184a25d9f950 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListBestUpdatesForGroupTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListBestUpdatesForGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListBestUpdatesForGroupTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listBestUpdatesForGroup("group1", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deviceClassId\":\"deviceClassId1\",\"deviceCount\":100,\"groupId\":\"group1\",\"update\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}}}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java new file mode 100644 index 000000000000..76c63cd0e68c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForDeviceClassSubgroupTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListDeploymentsForDeviceClassSubgroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeploymentsForDeviceClassSubgroupTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listDeploymentsForDeviceClassSubgroup( + "TestGroup", "deviceClassId1", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId1\",\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"0.9.0\"}}},\"startDateTime\":\"2020-07-01T12:13:14Z\",\"update\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}}}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java new file mode 100644 index 000000000000..4200667b31d5 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeploymentsForGroupTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListDeploymentsForGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeploymentsForGroupTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listDeploymentsForGroup("TestGroup", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentId\":\"deploymentId1\",\"deviceClassSubgroups\":[\"deviceClassId1\",\"deviceClassId2\"],\"groupId\":\"TestGroup\",\"isCanceled\":false,\"isCloudInitiatedRollback\":false,\"isRetried\":false,\"rollbackPolicy\":{\"failure\":{\"devicesFailedCount\":100,\"devicesFailedPercentage\":50},\"update\":{\"friendlyName\":\"Provider1 Name1 2022 Update\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"0.9.0\"}}},\"startDateTime\":\"2020-07-01T12:13:14Z\",\"update\":{\"friendlyName\":\"Provider1 Name1 2022 Update\",\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}}}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java new file mode 100644 index 000000000000..03d077fdbfee --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassSubgroupsForGroupTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListDeviceClassSubgroupsForGroupTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeviceClassSubgroupsForGroupTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.listDeviceClassSubgroupsForGroupWithResponse("group1", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"value\":[{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deploymentId\":\"MyDeployment\",\"deviceClassId\":\"DeviceClassId\",\"deviceCount\":149,\"groupId\":\"group1\"},{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deploymentId\":\"MyDeployment2\",\"deviceClassId\":\"DeviceClassId2\",\"deviceCount\":35,\"groupId\":\"group1\"}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java new file mode 100644 index 000000000000..935bc1ba51a3 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceClassesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListDeviceClassesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeviceClassesTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listDeviceClasses(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"bestCompatibleUpdate\":{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.0.0.0\"}},\"deviceClassId\":\"deviceClassId\",\"deviceClassProperties\":{\"compatProperties\":{\"manufacturer\":\"manufacturer1\",\"model\":\"model1\"},\"contractModel\":{\"name\":\"Device Update Model V2\",\"id\":\"dtmi:azure:iot:deviceUpdateContractModel;2\"}},\"friendlyName\":\"DeviceClass2020-04-22T12:12:12.0000000+00:00\"}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceHealthTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceHealthTests.java new file mode 100644 index 000000000000..3fb153c252c4 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDeviceHealthTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListDeviceHealthTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDeviceHealthTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.listDeviceHealthWithResponse("state eq 'unhealthy'", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"nextLink\":\"http://foo\",\"value\":[{\"deviceId\":\"device1\",\"digitalTwinModelId\":\"dtmi:foo;1\",\"healthChecks\":[{\"name\":\"check1\",\"result\":\"success\"},{\"name\":\"check2\",\"result\":\"userError\"}],\"moduleId\":\"module1\",\"state\":\"unhealthy\"}]}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesForDeviceClassSubgroupDeploymentTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesForDeviceClassSubgroupDeploymentTests.java new file mode 100644 index 000000000000..771505fddd3b --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesForDeviceClassSubgroupDeploymentTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListDevicesForDeviceClassSubgroupDeploymentTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDevicesForDeviceClassSubgroupDeploymentTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listDevicesForDeviceClassSubgroupDeployment( + "TestGroup", "deviceClassId", "deploymentId", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deviceId\":\"deviceId1\",\"deviceState\":\"Succeeded\",\"movedOnToNewDeployment\":false,\"retryCount\":1}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesTests.java new file mode 100644 index 000000000000..a4b1b41bf0c1 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListDevicesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListDevicesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListDevicesTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listDevices(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"deploymentStatus\":\"Failed\",\"deviceClassId\":\"deviceClassId1\",\"deviceId\":\"device1\",\"installedUpdate\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"1.0.0.0\"}},\"lastAttemptedUpdate\":{\"updateId\":{\"name\":\"name1\",\"provider\":\"provider1\",\"version\":\"2.0.0.0\"}},\"lastDeploymentId\":\"myDeployment123\",\"onLatestUpdate\":false}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListGroupsTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListGroupsTests.java new file mode 100644 index 000000000000..2f42408314a6 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListGroupsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListGroupsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListGroupsTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listGroups(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"createdDateTime\":\"2020-07-01T12:13:14.0000000Z\",\"deployments\":[\"deployment1\",\"deployment2\"],\"deviceCount\":100,\"groupId\":\"MyGroup1\",\"groupType\":\"IoTHubTag\",\"subgroupsWithNewUpdatesAvailableCount\":2,\"subgroupsWithOnLatestUpdateCount\":1,\"subgroupsWithUpdatesInProgressCount\":0}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java new file mode 100644 index 000000000000..85a38f7d3e13 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListInstallableUpdatesForDeviceClassTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListInstallableUpdatesForDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListInstallableUpdatesForDeviceClassTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceManagementClient.listInstallableUpdatesForDeviceClass("deviceClassId", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"friendlyName\":\"July 2022 Update\",\"updateId\":{\"name\":\"name\",\"provider\":\"provider\",\"version\":\"1.2.3.4\"}}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListLogCollectionOperationsTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListLogCollectionOperationsTests.java new file mode 100644 index 000000000000..e3931e871097 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListLogCollectionOperationsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListLogCollectionOperationsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListLogCollectionOperationsTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listLogCollectionOperations(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"SampleOperationId\",\"description\":\"Example diagnostics operation\",\"createdDateTime\":\"2021-09-30T02:23:41.59Z\",\"deviceList\":[{\"deviceId\":\"DeviceA\"},{\"deviceId\":\"DeviceB\",\"moduleId\":\"ModuleB\"}],\"lastActionDateTime\":\"2021-09-30T02:23:41.59Z\",\"status\":\"NotStarted\"}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListOperationsTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListOperationsTests.java new file mode 100644 index 000000000000..d1014e41c5be --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementListOperationsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementListOperationsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementListOperationsTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceManagementClient.listOperations(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\"}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java new file mode 100644 index 000000000000..5ef0bbbcf207 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceManagementUpdateDeviceClassTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceManagementUpdateDeviceClassTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceManagementUpdateDeviceClassTests() { + BinaryData deviceClassPatch = BinaryData.fromString("{\"friendlyName\":\"GA Webcams\"}"); + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceManagementClient.updateDeviceClassWithResponse("deviceClassId", deviceClassPatch, requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateClientTestBase.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateClientTestBase.java new file mode 100644 index 000000000000..862bf1fc2f95 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateClientTestBase.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +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.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.util.Configuration; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClient; +import com.azure.deviceupdate.deviceupdate.DeviceManagementClientBuilder; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClient; +import com.azure.deviceupdate.deviceupdate.DeviceUpdateClientBuilder; +import com.azure.identity.DefaultAzureCredentialBuilder; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +class DeviceUpdateClientTestBase extends TestBase { + protected DeviceUpdateClient deviceUpdateClient; + + protected DeviceManagementClient deviceManagementClient; + + @Override + protected void beforeTest() { + DeviceUpdateClientBuilder deviceUpdateClientbuilder = + new DeviceUpdateClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .instanceId(Configuration.getGlobalConfiguration().get("INSTANCEID", "instanceid")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + deviceUpdateClientbuilder + .httpClient(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(); + + DeviceManagementClientBuilder deviceManagementClientbuilder = + new DeviceManagementClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .instanceId(Configuration.getGlobalConfiguration().get("INSTANCEID", "instanceid")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + deviceManagementClientbuilder + .httpClient(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(); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java new file mode 100644 index 000000000000..f9d9b763e6af --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateDeleteUpdateTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateDeleteUpdateTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateDeleteUpdateTests() { + RequestOptions requestOptions = new RequestOptions(); + SyncPoller response = + deviceUpdateClient.beginDeleteUpdate("microsoft", "adu", "1.0.0.0", requestOptions); + Assertions.assertEquals( + LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetFileTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetFileTests.java new file mode 100644 index 000000000000..536948881681 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetFileTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateGetFileTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateGetFileTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceUpdateClient.getFileWithResponse("microsoft", "adu", "1.0.0.0", "abc123", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"etag\":\"\\\"26bd8eba-4bb2-4960-a357-ca4d60b5fb4b\\\"\",\"fileId\":\"abc123\",\"fileName\":\"1v5uww1q.my2\",\"hashes\":{\"sha256\":\"OVokcktf61lQXs17MzJCsM98lk48H1Wu1hy7Sp6lLfI=\"},\"mimeType\":\"application/BuildAsync-s4jwikgq.44h\",\"sizeInBytes\":1862311}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetOperationTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetOperationTests.java new file mode 100644 index 000000000000..8179f359cc19 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetOperationTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateGetOperationTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateGetOperationTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceUpdateClient.getOperationWithResponse("e4491c54-916f-443d-9094-bcca546ace2f", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"resourceLocation\":\"/deviceUpdate/blue/updates/providers/microsoft/names/adu/versions/1.0.0.0?api-version=2022-07-01-preview\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\",\"update\":{\"friendlyName\":\"Microsoft ADU v1\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetUpdateTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetUpdateTests.java new file mode 100644 index 000000000000..e76679880499 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateGetUpdateTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateGetUpdateTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateGetUpdateTests() { + RequestOptions requestOptions = new RequestOptions(); + Response response = + deviceUpdateClient.getUpdateWithResponse("microsoft", "adu", "1.0.0.0", requestOptions); + Assertions.assertEquals(200, response.getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"Fix for critical vulnerability\",\"compatibility\":[{\"deviceManufacturer\":\"Microsoft\",\"deviceModel\":\"Toaster\"}],\"createdDateTime\":\"2019-09-12T00:00:00.0000000+00:00\",\"etag\":\"\\\"3fed3378-0c67-47d2-b796-296962c66cbb\\\"\",\"friendlyName\":\"Lab Sensor Update v1\",\"importedDateTime\":\"2020-04-22T21:01:43.8408797+00:00\",\"instructions\":{\"steps\":[{\"description\":\"pre-install script\",\"files\":[\"configure.sh\"],\"handler\":\"microsoft/script:1\",\"handlerProperties\":{\"arguments\":\"--pre-install\"}},{\"type\":\"reference\",\"updateId\":{\"name\":\"sensor\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}]},\"manifestVersion\":\"5.0\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}") + .toObject(Object.class), + response.getValue().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateImportUpdateTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateImportUpdateTests.java new file mode 100644 index 000000000000..83d146b4aeb1 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateImportUpdateTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.SyncPoller; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateImportUpdateTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateImportUpdateTests() { + BinaryData updateToImport = + BinaryData.fromString( + "[{\"files\":[{\"filename\":\"file1.bin\",\"url\":\"http://test.blob.core.windows.net/test/upload1v5uww1q\"},{\"filename\":\"file2.bin\",\"url\":\"http://test.blob.core.windows.net/test/uploadkrmn5yw0\"},{\"filename\":\"file3.bin\",\"url\":\"http://test.blob.core.windows.net/test/uploaddq52ky5m\"}],\"importManifest\":{\"hashes\":{\"sha256\":\"O19LyyncPe1AGstOdkcmozLV8pSbBdqrE18HdYVohRc=\"},\"sizeInBytes\":816,\"url\":\"http://test.blob.core.windows.net/test/uploadimportMan.json\"}}]"); + RequestOptions requestOptions = new RequestOptions(); + SyncPoller response = + deviceUpdateClient.beginImportUpdate(updateToImport, requestOptions); + Assertions.assertEquals( + LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, response.waitForCompletion().getStatus()); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListFilesTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListFilesTests.java new file mode 100644 index 000000000000..812ef57ec9c7 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListFilesTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateListFilesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListFilesTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = + deviceUpdateClient.listFiles("microsoft", "adu", "1.0.0.0", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString("\"abc123\"").toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListNamesTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListNamesTests.java new file mode 100644 index 000000000000..b1b314240567 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListNamesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateListNamesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListNamesTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listNames("microsoft", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString("\"adu\"").toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListOperationsTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListOperationsTests.java new file mode 100644 index 000000000000..ca06d15fdcdc --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListOperationsTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateListOperationsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListOperationsTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listOperations(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"operationId\":\"e4491c54-916f-443d-9094-bcca546ace2f\",\"createdDateTime\":\"2020-04-22T21:00:53.2548897+00:00\",\"etag\":\"\\\"a0f7b6f2-3f6c-4eb6-8a59-2f5411c23888\\\"\",\"lastActionDateTime\":\"2020-04-22T21:01:43.9401420+00:00\",\"resourceLocation\":\"/deviceUpdate/blue/updates/providers/microsoft/names/adu/versions/1.0.0.0?api-version=2022-07-01-preview\",\"status\":\"Succeeded\",\"traceId\":\"2b881ef9deaf5d45b0a716ca5b4145ec\",\"update\":{\"friendlyName\":\"Microsoft ADU v1\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListProvidersTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListProvidersTests.java new file mode 100644 index 000000000000..c1abee1dfb21 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListProvidersTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateListProvidersTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListProvidersTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listProviders(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString("\"microsoft\"").toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListUpdatesTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListUpdatesTests.java new file mode 100644 index 000000000000..e009d55a381c --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListUpdatesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateListUpdatesTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListUpdatesTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listUpdates(requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString( + "{\"description\":\"Example update.\",\"compatibility\":[{\"deviceManufacturer\":\"Microsoft\",\"deviceModel\":\"Toaster\"}],\"createdDateTime\":\"2019-09-12T00:00:00.0000000+00:00\",\"etag\":\"\\\"3fed3378-0c67-47d2-b796-296962c66cbb\\\"\",\"importedDateTime\":\"2020-04-22T21:01:43.8408797+00:00\",\"instructions\":{\"steps\":[{\"description\":\"pre-install script\",\"files\":[\"configure.sh\"],\"handler\":\"microsoft/script:1\",\"handlerProperties\":{\"arguments\":\"--pre-install\"}},{\"type\":\"reference\",\"updateId\":{\"name\":\"sensor\",\"provider\":\"microsoft\",\"version\":\"1.0\"}}]},\"manifestVersion\":\"5.0\",\"updateId\":{\"name\":\"adu\",\"provider\":\"microsoft\",\"version\":\"1.0.0.0\"}}") + .toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListVersionsTests.java b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListVersionsTests.java new file mode 100644 index 000000000000..37394faf56de --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/src/test/java/com/azure/deviceupdate/deviceupdate/generated/DeviceUpdateListVersionsTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.deviceupdate.deviceupdate.generated; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public final class DeviceUpdateListVersionsTests extends DeviceUpdateClientTestBase { + @Test + @Disabled + public void testDeviceUpdateListVersionsTests() { + RequestOptions requestOptions = new RequestOptions(); + PagedIterable response = deviceUpdateClient.listVersions("microsoft", "adu", requestOptions); + Assertions.assertEquals(200, response.iterableByPage().iterator().next().getStatusCode()); + Assertions.assertEquals( + BinaryData.fromString("\"1.0.0.0\"").toObject(Object.class), + response.iterator().next().toObject(Object.class)); + } +} diff --git a/sdk/deviceupdate/azure-deviceupdate-deviceupdate/swagger/README.md b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/swagger/README.md new file mode 100644 index 000000000000..8d366813e238 --- /dev/null +++ b/sdk/deviceupdate/azure-deviceupdate-deviceupdate/swagger/README.md @@ -0,0 +1,16 @@ +## Generate autorest code + +```yaml +input-file: +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/deviceupdate/data-plane/Microsoft.DeviceUpdate/preview/2022-07-01-preview/deviceupdate.json +output-folder: ../ +java: true +regenerate-pom: false +data-plane: true +generate-tests: true +artifact-id: azure-deviceupdate-deviceupdate +generate-samples: true +namespace: com.azure.deviceupdate.deviceupdate +service-versions: +- 2022-07-01-preview +``` diff --git a/sdk/deviceupdate/ci.yml b/sdk/deviceupdate/ci.yml index e64c4a1a4d92..33ce8bef4c87 100644 --- a/sdk/deviceupdate/ci.yml +++ b/sdk/deviceupdate/ci.yml @@ -38,3 +38,6 @@ extends: - name: azure-resourcemanager-deviceupdate groupId: com.azure.resourcemanager safeName: azureresourcemanagerdeviceupdate + - name: azure-deviceupdate-deviceupdate + groupId: com.azure + safeName: azuredeviceupdatedeviceupdate diff --git a/sdk/deviceupdate/pom.xml b/sdk/deviceupdate/pom.xml index cecc973362c6..b19ce6252798 100644 --- a/sdk/deviceupdate/pom.xml +++ b/sdk/deviceupdate/pom.xml @@ -42,6 +42,7 @@ true + azure-deviceupdate-deviceupdate azure-iot-deviceupdate azure-resourcemanager-deviceupdate