diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index ba7c1fe2af38..c33cab7cc47f 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -275,6 +275,7 @@ com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;7.4.0;7.5.0-be
com.azure.spring:spring-cloud-azure-stream-binder-servicebus;7.4.0;7.5.0-beta.1
com.azure.spring:spring-cloud-azure-testcontainers;7.4.0;7.5.0-beta.1
com.azure:azure-spring-data-cosmos;7.4.0;7.5.0-beta.1
+com.azure:azure-iot-deviceregistry-softwareupdate;1.0.0-beta.1;1.0.0-beta.1
com.azure.resourcemanager:azure-resourcemanager;2.63.0;2.64.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-appplatform;2.51.0;2.52.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-appservice;2.56.0;2.57.0-beta.1
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/CHANGELOG.md b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/CHANGELOG.md
new file mode 100644
index 000000000000..5aa2e8647fc4
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/CHANGELOG.md
@@ -0,0 +1,16 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+- Azure DeviceRegistrySoftwareUpdateClient client library for Java. This package contains Microsoft Azure DeviceRegistrySoftwareUpdateClient client library.
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
+### Features Added
+
+- Initial release for the azure-iot-deviceregistry-softwareupdate Java SDK.
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/README.md b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/README.md
new file mode 100644
index 000000000000..fffca3f5b387
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/README.md
@@ -0,0 +1,78 @@
+# Azure DeviceRegistrySoftwareUpdateClient client library for Java
+
+Azure DeviceRegistrySoftwareUpdateClient client library for Java.
+
+This package contains Microsoft Azure DeviceRegistrySoftwareUpdateClient 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-iot-deviceregistry-softwareupdate;current})
+```xml
+
+ com.azure
+ azure-iot-deviceregistry-softwareupdate
+ 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.iot.deviceregistry.softwareupdate.readme
+```
+
+### Service API versions
+
+The client library targets the latest service API version by default.
+The service client builder accepts an optional service API version parameter to specify which API version to communicate.
+
+#### Select a service API version
+
+You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder.
+This ensures that the client can communicate with services using the specified API version.
+
+When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version.
+If there are significant differences, API calls may fail due to incompatibility.
+
+Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy.
+
+## 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://learn.microsoft.com/azure/developer/java/fundamentals/
+[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/deviceregistry/azure-iot-deviceregistry-softwareupdate/assets.json b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/assets.json
new file mode 100644
index 000000000000..15933b7dd202
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/assets.json
@@ -0,0 +1 @@
+{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/deviceregistry/azure-iot-deviceregistry-softwareupdate","Tag":""}
\ No newline at end of file
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/pom.xml b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/pom.xml
new file mode 100644
index 000000000000..a39259b39dcc
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/pom.xml
@@ -0,0 +1,71 @@
+
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure
+ azure-iot-deviceregistry-softwareupdate
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for DeviceRegistrySoftwareUpdateClient
+ This package contains Microsoft Azure DeviceRegistrySoftwareUpdateClient 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
+
+
+
+ com.azure
+ azure-core
+ 1.59.0
+
+
+ com.azure
+ azure-core-http-netty
+ 1.16.6
+
+
+ com.azure
+ azure-core-test
+ 1.27.0-beta.17
+ test
+
+
+ com.azure
+ azure-identity
+ 1.18.4
+ test
+
+
+
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceClassesAsyncClient.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceClassesAsyncClient.java
new file mode 100644
index 000000000000..3f3c191f7c6d
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceClassesAsyncClient.java
@@ -0,0 +1,210 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate;
+
+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.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.FluxUtil;
+import com.azure.iot.deviceregistry.softwareupdate.implementation.DeviceClassesImpl;
+import com.azure.iot.deviceregistry.softwareupdate.models.DeviceClass;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the asynchronous DeviceRegistrySoftwareUpdateClient type.
+ */
+@ServiceClient(builder = DeviceRegistrySoftwareUpdateClientBuilder.class, isAsync = true)
+public final class DeviceClassesAsyncClient {
+ @Generated
+ private final DeviceClassesImpl serviceClient;
+
+ /**
+ * Initializes an instance of DeviceClassesAsyncClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ DeviceClassesAsyncClient(DeviceClassesImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Gets a list of device classes.
+ *
Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux list(RequestOptions requestOptions) {
+ return this.serviceClient.listAsync(requestOptions);
+ }
+
+ /**
+ * Gets the properties of a device class.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param deviceClassId Device class identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return 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);
+ }
+
+ /**
+ * 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> deleteWithResponse(String deviceClassId, RequestOptions requestOptions) {
+ return this.serviceClient.deleteWithResponseAsync(deviceClassId, requestOptions);
+ }
+
+ /**
+ * Gets a list of device classes.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of device classes as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux list() {
+ // Generated convenience method for list
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = list(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(DeviceClass.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Gets the properties of a device class.
+ *
+ * @param deviceClassId Device class identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the properties of a device class on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getDeviceClass(String deviceClassId) {
+ // Generated convenience method for getDeviceClassWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getDeviceClassWithResponse(deviceClassId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(DeviceClass.class));
+ }
+
+ /**
+ * Deletes a device class.
+ *
+ * @param deviceClassId Device class identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono delete(String deviceClassId) {
+ // Generated convenience method for deleteWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return deleteWithResponse(deviceClassId, requestOptions).flatMap(FluxUtil::toMono);
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceClassesClient.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceClassesClient.java
new file mode 100644
index 000000000000..24a73c58b10d
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceClassesClient.java
@@ -0,0 +1,190 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate;
+
+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.iot.deviceregistry.softwareupdate.implementation.DeviceClassesImpl;
+import com.azure.iot.deviceregistry.softwareupdate.models.DeviceClass;
+
+/**
+ * Initializes a new instance of the synchronous DeviceRegistrySoftwareUpdateClient type.
+ */
+@ServiceClient(builder = DeviceRegistrySoftwareUpdateClientBuilder.class)
+public final class DeviceClassesClient {
+ @Generated
+ private final DeviceClassesImpl serviceClient;
+
+ /**
+ * Initializes an instance of DeviceClassesClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ DeviceClassesClient(DeviceClassesImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Gets a list of device classes.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(RequestOptions requestOptions) {
+ return this.serviceClient.list(requestOptions);
+ }
+
+ /**
+ * Gets the properties of a device class.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param deviceClassId Device class identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the properties of a device class along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) {
+ return this.serviceClient.getDeviceClassWithResponse(deviceClassId, requestOptions);
+ }
+
+ /**
+ * 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 deleteWithResponse(String deviceClassId, RequestOptions requestOptions) {
+ return this.serviceClient.deleteWithResponse(deviceClassId, requestOptions);
+ }
+
+ /**
+ * Gets a list of device classes.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of device classes as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ // Generated convenience method for list
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.list(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(DeviceClass.class));
+ }
+
+ /**
+ * Gets the properties of a device class.
+ *
+ * @param deviceClassId Device class identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the properties of a device class.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public DeviceClass getDeviceClass(String deviceClassId) {
+ // Generated convenience method for getDeviceClassWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getDeviceClassWithResponse(deviceClassId, requestOptions).getValue().toObject(DeviceClass.class);
+ }
+
+ /**
+ * Deletes a device class.
+ *
+ * @param deviceClassId Device class identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String deviceClassId) {
+ // Generated convenience method for deleteWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ deleteWithResponse(deviceClassId, requestOptions).getValue();
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceRegistrySoftwareUpdateClientBuilder.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceRegistrySoftwareUpdateClientBuilder.java
new file mode 100644
index 000000000000..f496ee0ed9bd
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceRegistrySoftwareUpdateClientBuilder.java
@@ -0,0 +1,361 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.client.traits.ConfigurationTrait;
+import com.azure.core.client.traits.EndpointTrait;
+import com.azure.core.client.traits.HttpTrait;
+import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.HttpPipelinePosition;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.AddHeadersFromContextPolicy;
+import com.azure.core.http.policy.AddHeadersPolicy;
+import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryOptions;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.util.ClientOptions;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.builder.ClientBuilderUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.serializer.JacksonAdapter;
+import com.azure.iot.deviceregistry.softwareupdate.implementation.DeviceRegistrySoftwareUpdateClientImpl;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * A builder for creating a new instance of the DeviceRegistrySoftwareUpdateClient type.
+ */
+@ServiceClientBuilder(
+ serviceClients = {
+ DeviceClassesClient.class,
+ SoftwareUpdateClient.class,
+ DeviceClassesAsyncClient.class,
+ SoftwareUpdateAsyncClient.class })
+public final class DeviceRegistrySoftwareUpdateClientBuilder implements
+ HttpTrait, ConfigurationTrait,
+ TokenCredentialTrait,
+ EndpointTrait {
+ @Generated
+ private static final String SDK_NAME = "name";
+
+ @Generated
+ private static final String SDK_VERSION = "version";
+
+ @Generated
+ private static final String[] DEFAULT_SCOPES = new String[] { "https://api.adu.microsoft.com/.default" };
+
+ @Generated
+ private static final Map PROPERTIES
+ = CoreUtils.getProperties("azure-iot-deviceregistry-softwareupdate.properties");
+
+ @Generated
+ private final List pipelinePolicies;
+
+ /**
+ * Create an instance of the DeviceRegistrySoftwareUpdateClientBuilder.
+ */
+ @Generated
+ public DeviceRegistrySoftwareUpdateClientBuilder() {
+ this.pipelinePolicies = new ArrayList<>();
+ }
+
+ /*
+ * The HTTP client used to send the request.
+ */
+ @Generated
+ private HttpClient httpClient;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public DeviceRegistrySoftwareUpdateClientBuilder httpClient(HttpClient httpClient) {
+ this.httpClient = httpClient;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through.
+ */
+ @Generated
+ private HttpPipeline pipeline;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public DeviceRegistrySoftwareUpdateClientBuilder pipeline(HttpPipeline pipeline) {
+ if (this.pipeline != null && pipeline == null) {
+ LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured.");
+ }
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The logging configuration for HTTP requests and responses.
+ */
+ @Generated
+ private HttpLogOptions httpLogOptions;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public DeviceRegistrySoftwareUpdateClientBuilder 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 DeviceRegistrySoftwareUpdateClientBuilder 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 DeviceRegistrySoftwareUpdateClientBuilder retryOptions(RetryOptions retryOptions) {
+ this.retryOptions = retryOptions;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public DeviceRegistrySoftwareUpdateClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
+ Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null.");
+ pipelinePolicies.add(customPolicy);
+ return this;
+ }
+
+ /*
+ * The configuration store that is used during construction of the service client.
+ */
+ @Generated
+ private Configuration configuration;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public DeviceRegistrySoftwareUpdateClientBuilder configuration(Configuration configuration) {
+ this.configuration = configuration;
+ return this;
+ }
+
+ /*
+ * The TokenCredential used for authentication.
+ */
+ @Generated
+ private TokenCredential tokenCredential;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public DeviceRegistrySoftwareUpdateClientBuilder credential(TokenCredential tokenCredential) {
+ this.tokenCredential = tokenCredential;
+ return this;
+ }
+
+ /*
+ * The service endpoint
+ */
+ @Generated
+ private String endpoint;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public DeviceRegistrySoftwareUpdateClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * Service version
+ */
+ @Generated
+ private DeviceRegistrySoftwareUpdateServiceVersion serviceVersion;
+
+ /**
+ * Sets Service version.
+ *
+ * @param serviceVersion the serviceVersion value.
+ * @return the DeviceRegistrySoftwareUpdateClientBuilder.
+ */
+ @Generated
+ public DeviceRegistrySoftwareUpdateClientBuilder
+ serviceVersion(DeviceRegistrySoftwareUpdateServiceVersion 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 DeviceRegistrySoftwareUpdateClientBuilder.
+ */
+ @Generated
+ public DeviceRegistrySoftwareUpdateClientBuilder retryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = retryPolicy;
+ return this;
+ }
+
+ /**
+ * Builds an instance of DeviceRegistrySoftwareUpdateClientImpl with the provided parameters.
+ *
+ * @return an instance of DeviceRegistrySoftwareUpdateClientImpl.
+ */
+ @Generated
+ private DeviceRegistrySoftwareUpdateClientImpl buildInnerClient() {
+ this.validateClient();
+ HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
+ DeviceRegistrySoftwareUpdateServiceVersion localServiceVersion
+ = (serviceVersion != null) ? serviceVersion : DeviceRegistrySoftwareUpdateServiceVersion.getLatest();
+ DeviceRegistrySoftwareUpdateClientImpl client = new DeviceRegistrySoftwareUpdateClientImpl(localPipeline,
+ JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion);
+ return client;
+ }
+
+ @Generated
+ private void validateClient() {
+ // This method is invoked from 'buildInnerClient'/'buildClient' method.
+ // Developer can customize this method, to validate that the necessary conditions are met for the new client.
+ Objects.requireNonNull(endpoint, "'endpoint' cannot be null.");
+ }
+
+ @Generated
+ private HttpPipeline createHttpPipeline() {
+ Configuration buildConfiguration
+ = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
+ HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions;
+ ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions;
+ List policies = new ArrayList<>();
+ String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+ String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions);
+ policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));
+ policies.add(new RequestIdPolicy());
+ policies.add(new AddHeadersFromContextPolicy());
+ HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions);
+ if (headers != null) {
+ policies.add(new AddHeadersPolicy(headers));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .forEach(p -> policies.add(p));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
+ policies.add(new AddDatePolicy());
+ if (tokenCredential != null) {
+ policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .forEach(p -> policies.add(p));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(localHttpLogOptions));
+ HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .httpClient(httpClient)
+ .clientOptions(localClientOptions)
+ .build();
+ return httpPipeline;
+ }
+
+ /**
+ * Builds an instance of DeviceClassesAsyncClient class.
+ *
+ * @return an instance of DeviceClassesAsyncClient.
+ */
+ @Generated
+ public DeviceClassesAsyncClient buildDeviceClassesAsyncClient() {
+ return new DeviceClassesAsyncClient(buildInnerClient().getDeviceClasses());
+ }
+
+ /**
+ * Builds an instance of SoftwareUpdateAsyncClient class.
+ *
+ * @return an instance of SoftwareUpdateAsyncClient.
+ */
+ @Generated
+ public SoftwareUpdateAsyncClient buildSoftwareUpdateAsyncClient() {
+ return new SoftwareUpdateAsyncClient(buildInnerClient().getSoftwareUpdates());
+ }
+
+ /**
+ * Builds an instance of DeviceClassesClient class.
+ *
+ * @return an instance of DeviceClassesClient.
+ */
+ @Generated
+ public DeviceClassesClient buildDeviceClassesClient() {
+ return new DeviceClassesClient(buildInnerClient().getDeviceClasses());
+ }
+
+ /**
+ * Builds an instance of SoftwareUpdateClient class.
+ *
+ * @return an instance of SoftwareUpdateClient.
+ */
+ @Generated
+ public SoftwareUpdateClient buildSoftwareUpdateClient() {
+ return new SoftwareUpdateClient(buildInnerClient().getSoftwareUpdates());
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DeviceRegistrySoftwareUpdateClientBuilder.class);
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceRegistrySoftwareUpdateServiceVersion.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceRegistrySoftwareUpdateServiceVersion.java
new file mode 100644
index 000000000000..e810235ba16b
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/DeviceRegistrySoftwareUpdateServiceVersion.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate;
+
+import com.azure.core.util.ServiceVersion;
+
+/**
+ * Service version of DeviceRegistrySoftwareUpdateClient.
+ */
+public enum DeviceRegistrySoftwareUpdateServiceVersion implements ServiceVersion {
+ /**
+ * Enum value 2026-11-02-preview.
+ */
+ V2026_11_02_PREVIEW("2026-11-02-preview");
+
+ private final String version;
+
+ DeviceRegistrySoftwareUpdateServiceVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getVersion() {
+ return this.version;
+ }
+
+ /**
+ * Gets the latest service version supported by this client library.
+ *
+ * @return The latest {@link DeviceRegistrySoftwareUpdateServiceVersion}.
+ */
+ public static DeviceRegistrySoftwareUpdateServiceVersion getLatest() {
+ return V2026_11_02_PREVIEW;
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/SoftwareUpdateAsyncClient.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/SoftwareUpdateAsyncClient.java
new file mode 100644
index 000000000000..e60da18a7d84
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/SoftwareUpdateAsyncClient.java
@@ -0,0 +1,1137 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate;
+
+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.HttpHeaderName;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.iot.deviceregistry.softwareupdate.implementation.SoftwareUpdatesImpl;
+import com.azure.iot.deviceregistry.softwareupdate.models.ImportUpdateRequest;
+import com.azure.iot.deviceregistry.softwareupdate.models.Update;
+import com.azure.iot.deviceregistry.softwareupdate.models.UpdateFile;
+import com.azure.iot.deviceregistry.softwareupdate.models.UpdateOperation;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the asynchronous DeviceRegistrySoftwareUpdateClient type.
+ */
+@ServiceClient(builder = DeviceRegistrySoftwareUpdateClientBuilder.class, isAsync = true)
+public final class SoftwareUpdateAsyncClient {
+ @Generated
+ private final SoftwareUpdatesImpl serviceClient;
+
+ /**
+ * Initializes an instance of SoftwareUpdateAsyncClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ SoftwareUpdateAsyncClient(SoftwareUpdatesImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | search | String | No | Request updates matching a free-text search
+ * expression. |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry 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
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of update metadata.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginImportUpdate(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginImportUpdateAsync(importUpdateRequest, requestOptions);
+ }
+
+ /**
+ * Get a specific update version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update version along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getUpdateWithResponse(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getUpdateWithResponseAsync(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginDeleteUpdate(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginDeleteUpdateAsync(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Get a list of all update providers that have been imported to Software Update for
+ * Device Registry.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listProviders(RequestOptions requestOptions) {
+ return this.serviceClient.listProvidersAsync(requestOptions);
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listNames(String provider, RequestOptions requestOptions) {
+ return this.serviceClient.listNamesAsync(provider, requestOptions);
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listVersions(String provider, String name, RequestOptions requestOptions) {
+ return this.serviceClient.listVersionsAsync(provider, name, requestOptions);
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version as paginated response with
+ * {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listFiles(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listFilesAsync(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Get a specific update file from the version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * fileId: String (Required)
+ * relatedFiles (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * downloadHandler (Optional): {
+ * id: String (Required)
+ * }
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update file from the version along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getFileWithResponse(String provider, String name, String version, String fileId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getFileWithResponseAsync(provider, name, version, fileId, requestOptions);
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter operations by status property. Only one
+ * specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'" |
+ * | maxpagesize | Integer | No | Specifies a non-negative integer n that limits the number
+ * of items returned
+ * from a collection. The service returns the number of available items up to but
+ * not greater than the specified value n. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listOperationStatuses(RequestOptions requestOptions) {
+ return this.serviceClient.listOperationStatusesAsync(requestOptions);
+ }
+
+ /**
+ * Retrieve operation status.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | Retry-After | String | Number of seconds to wait before checking the operation status
+ * again. |
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return operation metadata along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getOperationStatusWithResponse(String operationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getOperationStatusWithResponseAsync(operationId, requestOptions);
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ *
+ * @param search Request updates matching a free-text search expression.
+ * @param filter Optional to filter updates by isDeployable property.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listUpdates(String search, String filter) {
+ // Generated convenience method for listUpdates
+ RequestOptions requestOptions = new RequestOptions();
+ if (search != null) {
+ requestOptions.addQueryParam("search", search, false);
+ }
+ if (filter != null) {
+ requestOptions.addQueryParam("filter", filter, false);
+ }
+ PagedFlux pagedFluxResponse = listUpdates(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(Update.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listUpdates() {
+ // Generated convenience method for listUpdates
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listUpdates(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(Update.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of update metadata.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginImportUpdate(ImportUpdateRequest importUpdateRequest) {
+ // Generated convenience method for beginImportUpdateWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginImportUpdateWithModelAsync(BinaryData.fromObject(importUpdateRequest),
+ requestOptions);
+ }
+
+ /**
+ * Get a specific update version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if
+ * the ETag on the server does not match this value.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update version on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getUpdate(String provider, String name, String version, String ifNoneMatch) {
+ // Generated convenience method for getUpdateWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifNoneMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch);
+ }
+ return getUpdateWithResponse(provider, name, version, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(Update.class));
+ }
+
+ /**
+ * Get a specific update version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update version on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getUpdate(String provider, String name, String version) {
+ // Generated convenience method for getUpdateWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getUpdateWithResponse(provider, name, version, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(Update.class));
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginDeleteUpdate(String provider, String name, String version) {
+ // Generated convenience method for beginDeleteUpdateWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginDeleteUpdateWithModelAsync(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Get a list of all update providers that have been imported to Software Update for
+ * Device Registry.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listProviders() {
+ // Generated convenience method for listProviders
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listProviders(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(String.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ *
+ * @param provider Update provider.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update names that match the specified provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listNames(String provider) {
+ // Generated convenience method for listNames
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listNames(provider, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(String.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param filter Optional to filter updates by isDeployable property.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listVersions(String provider, String name, String filter) {
+ // Generated convenience method for listVersions
+ RequestOptions requestOptions = new RequestOptions();
+ if (filter != null) {
+ requestOptions.addQueryParam("filter", filter, false);
+ }
+ PagedFlux pagedFluxResponse = listVersions(provider, name, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(String.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listVersions(String provider, String name) {
+ // Generated convenience method for listVersions
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listVersions(provider, name, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(String.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update file identifiers for the specified version as paginated response with
+ * {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listFiles(String provider, String name, String version) {
+ // Generated convenience method for listFiles
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listFiles(provider, name, version, requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(String.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a specific update file from the version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if
+ * the ETag on the server does not match this value.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update file from the version on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getFile(String provider, String name, String version, String fileId, String ifNoneMatch) {
+ // Generated convenience method for getFileWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifNoneMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch);
+ }
+ return getFileWithResponse(provider, name, version, fileId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(UpdateFile.class));
+ }
+
+ /**
+ * Get a specific update file from the version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update file from the version on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getFile(String provider, String name, String version, String fileId) {
+ // Generated convenience method for getFileWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getFileWithResponse(provider, name, version, fileId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(UpdateFile.class));
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ *
+ * @param filter Optional to filter operations by status property. Only one specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'".
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all import update operations as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listOperationStatuses(String filter) {
+ // Generated convenience method for listOperationStatuses
+ RequestOptions requestOptions = new RequestOptions();
+ if (filter != null) {
+ requestOptions.addQueryParam("filter", filter, false);
+ }
+ PagedFlux pagedFluxResponse = listOperationStatuses(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all import update operations as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listOperationStatuses() {
+ // Generated convenience method for listOperationStatuses
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listOperationStatuses(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Retrieve operation status.
+ *
+ * @param operationId Operation identifier.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if
+ * the ETag on the server does not match this value.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return operation metadata on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getOperationStatus(String operationId, String ifNoneMatch) {
+ // Generated convenience method for getOperationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifNoneMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch);
+ }
+ return getOperationStatusWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class));
+ }
+
+ /**
+ * Retrieve operation status.
+ *
+ * @param operationId Operation identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return operation metadata on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getOperationStatus(String operationId) {
+ // Generated convenience method for getOperationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getOperationStatusWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(UpdateOperation.class));
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/SoftwareUpdateClient.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/SoftwareUpdateClient.java
new file mode 100644
index 000000000000..4506be7b703f
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/SoftwareUpdateClient.java
@@ -0,0 +1,1023 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate;
+
+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.HttpHeaderName;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.iot.deviceregistry.softwareupdate.implementation.SoftwareUpdatesImpl;
+import com.azure.iot.deviceregistry.softwareupdate.models.ImportUpdateRequest;
+import com.azure.iot.deviceregistry.softwareupdate.models.Update;
+import com.azure.iot.deviceregistry.softwareupdate.models.UpdateFile;
+import com.azure.iot.deviceregistry.softwareupdate.models.UpdateOperation;
+
+/**
+ * Initializes a new instance of the synchronous DeviceRegistrySoftwareUpdateClient type.
+ */
+@ServiceClient(builder = DeviceRegistrySoftwareUpdateClientBuilder.class)
+public final class SoftwareUpdateClient {
+ @Generated
+ private final SoftwareUpdatesImpl serviceClient;
+
+ /**
+ * Initializes an instance of SoftwareUpdateClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ SoftwareUpdateClient(SoftwareUpdatesImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | search | String | No | Request updates matching a free-text search
+ * expression. |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listUpdates(RequestOptions requestOptions) {
+ return this.serviceClient.listUpdates(requestOptions);
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of update metadata.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginImportUpdate(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginImportUpdate(importUpdateRequest, requestOptions);
+ }
+
+ /**
+ * Get a specific update version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update version along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getUpdateWithResponse(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getUpdateWithResponse(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginDeleteUpdate(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginDeleteUpdate(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Get a list of all update providers that have been imported to Software Update for
+ * Device Registry.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listProviders(RequestOptions requestOptions) {
+ return this.serviceClient.listProviders(requestOptions);
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listNames(String provider, RequestOptions requestOptions) {
+ return this.serviceClient.listNames(provider, requestOptions);
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) {
+ return this.serviceClient.listVersions(provider, name, requestOptions);
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version as paginated response with
+ * {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listFiles(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return this.serviceClient.listFiles(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Get a specific update file from the version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * fileId: String (Required)
+ * relatedFiles (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * downloadHandler (Optional): {
+ * id: String (Required)
+ * }
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update file from the version along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getFileWithResponse(String provider, String name, String version, String fileId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getFileWithResponse(provider, name, version, fileId, requestOptions);
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter operations by status property. Only one
+ * specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'" |
+ * | maxpagesize | Integer | No | Specifies a non-negative integer n that limits the number
+ * of items returned
+ * from a collection. The service returns the number of available items up to but
+ * not greater than the specified value n. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listOperationStatuses(RequestOptions requestOptions) {
+ return this.serviceClient.listOperationStatuses(requestOptions);
+ }
+
+ /**
+ * Retrieve operation status.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | Retry-After | String | Number of seconds to wait before checking the operation status
+ * again. |
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return operation metadata along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) {
+ return this.serviceClient.getOperationStatusWithResponse(operationId, requestOptions);
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ *
+ * @param search Request updates matching a free-text search expression.
+ * @param filter Optional to filter updates by isDeployable property.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listUpdates(String search, String filter) {
+ // Generated convenience method for listUpdates
+ RequestOptions requestOptions = new RequestOptions();
+ if (search != null) {
+ requestOptions.addQueryParam("search", search, false);
+ }
+ if (filter != null) {
+ requestOptions.addQueryParam("filter", filter, false);
+ }
+ return serviceClient.listUpdates(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Update.class));
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listUpdates() {
+ // Generated convenience method for listUpdates
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listUpdates(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Update.class));
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of update metadata.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginImportUpdate(ImportUpdateRequest importUpdateRequest) {
+ // Generated convenience method for beginImportUpdateWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginImportUpdateWithModel(BinaryData.fromObject(importUpdateRequest), requestOptions);
+ }
+
+ /**
+ * Get a specific update version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if
+ * the ETag on the server does not match this value.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update version.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Update getUpdate(String provider, String name, String version, String ifNoneMatch) {
+ // Generated convenience method for getUpdateWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifNoneMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch);
+ }
+ return getUpdateWithResponse(provider, name, version, requestOptions).getValue().toObject(Update.class);
+ }
+
+ /**
+ * Get a specific update version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update version.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Update getUpdate(String provider, String name, String version) {
+ // Generated convenience method for getUpdateWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getUpdateWithResponse(provider, name, version, requestOptions).getValue().toObject(Update.class);
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginDeleteUpdate(String provider, String name, String version) {
+ // Generated convenience method for beginDeleteUpdateWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginDeleteUpdateWithModel(provider, name, version, requestOptions);
+ }
+
+ /**
+ * Get a list of all update providers that have been imported to Software Update for
+ * Device Registry.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listProviders() {
+ // Generated convenience method for listProviders
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listProviders(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class));
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ *
+ * @param provider Update provider.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update names that match the specified provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listNames(String provider) {
+ // Generated convenience method for listNames
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listNames(provider, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class));
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param filter Optional to filter updates by isDeployable property.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listVersions(String provider, String name, String filter) {
+ // Generated convenience method for listVersions
+ RequestOptions requestOptions = new RequestOptions();
+ if (filter != null) {
+ requestOptions.addQueryParam("filter", filter, false);
+ }
+ return serviceClient.listVersions(provider, name, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class));
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listVersions(String provider, String name) {
+ // Generated convenience method for listVersions
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listVersions(provider, name, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class));
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all update file identifiers for the specified version as paginated response with
+ * {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listFiles(String provider, String name, String version) {
+ // Generated convenience method for listFiles
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listFiles(provider, name, version, requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(String.class));
+ }
+
+ /**
+ * Get a specific update file from the version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if
+ * the ETag on the server does not match this value.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update file from the version.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateFile getFile(String provider, String name, String version, String fileId, String ifNoneMatch) {
+ // Generated convenience method for getFileWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifNoneMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch);
+ }
+ return getFileWithResponse(provider, name, version, fileId, requestOptions).getValue()
+ .toObject(UpdateFile.class);
+ }
+
+ /**
+ * Get a specific update file from the version.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a specific update file from the version.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateFile getFile(String provider, String name, String version, String fileId) {
+ // Generated convenience method for getFileWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getFileWithResponse(provider, name, version, fileId, requestOptions).getValue()
+ .toObject(UpdateFile.class);
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ *
+ * @param filter Optional to filter operations by status property. Only one specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'".
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all import update operations as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listOperationStatuses(String filter) {
+ // Generated convenience method for listOperationStatuses
+ RequestOptions requestOptions = new RequestOptions();
+ if (filter != null) {
+ requestOptions.addQueryParam("filter", filter, false);
+ }
+ return serviceClient.listOperationStatuses(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(UpdateOperation.class));
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of all import update operations as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listOperationStatuses() {
+ // Generated convenience method for listOperationStatuses
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listOperationStatuses(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(UpdateOperation.class));
+ }
+
+ /**
+ * Retrieve operation status.
+ *
+ * @param operationId Operation identifier.
+ * @param ifNoneMatch Defines the If-None-Match condition. The operation will be performed only if
+ * the ETag on the server does not match this value.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return operation metadata.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateOperation getOperationStatus(String operationId, String ifNoneMatch) {
+ // Generated convenience method for getOperationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ if (ifNoneMatch != null) {
+ requestOptions.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch);
+ }
+ return getOperationStatusWithResponse(operationId, requestOptions).getValue().toObject(UpdateOperation.class);
+ }
+
+ /**
+ * Retrieve operation status.
+ *
+ * @param operationId Operation identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return operation metadata.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateOperation getOperationStatus(String operationId) {
+ // Generated convenience method for getOperationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getOperationStatusWithResponse(operationId, requestOptions).getValue().toObject(UpdateOperation.class);
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/DeviceClassesImpl.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/DeviceClassesImpl.java
new file mode 100644
index 000000000000..49de65b27a67
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/DeviceClassesImpl.java
@@ -0,0 +1,549 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.implementation;
+
+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.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.iot.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateServiceVersion;
+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 DeviceClasses.
+ */
+public final class DeviceClassesImpl {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final DeviceClassesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DeviceRegistrySoftwareUpdateClientImpl client;
+
+ /**
+ * Initializes an instance of DeviceClassesImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ DeviceClassesImpl(DeviceRegistrySoftwareUpdateClientImpl client) {
+ this.service
+ = RestProxy.create(DeviceClassesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * Gets Service version.
+ *
+ * @return the serviceVersion value.
+ */
+ public DeviceRegistrySoftwareUpdateServiceVersion getServiceVersion() {
+ return client.getServiceVersion();
+ }
+
+ /**
+ * The interface defining all the services for DeviceRegistrySoftwareUpdateClientDeviceClasses to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("https://{endpoint}")
+ @ServiceInterface(name = "DeviceRegistrySoftwareUpdateClientDeviceClasses")
+ public interface DeviceClassesService {
+ @Get("/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> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/management/deviceClasses")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/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,
+ @QueryParam("api-version") String apiVersion, @PathParam("deviceClassId") String deviceClassId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/management/deviceClasses/{deviceClassId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getDeviceClassSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("deviceClassId") String deviceClassId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Delete("/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> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("deviceClassId") String deviceClassId,
+ RequestOptions requestOptions, Context context);
+
+ @Delete("/management/deviceClasses/{deviceClassId}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("deviceClassId") String deviceClassId, 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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+ }
+
+ /**
+ * Gets a list of device classes.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(),
+ 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 device classes.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAsync(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedFlux<>(() -> listSinglePageAsync(requestOptions),
+ nextLink -> listNextSinglePageAsync(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Gets a list of device classes.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Gets a list of device classes.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(() -> listSinglePage(requestOptions),
+ nextLink -> listNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Gets the properties of a device class.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param deviceClassId Device class identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return 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.getServiceVersion().getVersion(), deviceClassId, accept, requestOptions, context));
+ }
+
+ /**
+ * Gets the properties of a device class.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param deviceClassId Device class identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the properties of a device class along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getDeviceClassSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ deviceClassId, accept, requestOptions, Context.NONE);
+ }
+
+ /**
+ * 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> deleteWithResponseAsync(String deviceClassId, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), deviceClassId, 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 deleteWithResponse(String deviceClassId, RequestOptions requestOptions) {
+ return service.deleteSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ deviceClassId, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * deviceClassId: String (Required)
+ * deviceClassProperties (Required): {
+ * compatProperties (Required): {
+ * String: String (Required)
+ * }
+ * agentProfile: int (Required)
+ * }
+ * bestCompatibleUpdate (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of device classes along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ private List getValues(BinaryData binaryData, String... path) {
+ try {
+ Object value = binaryData.toObject(Map.class);
+ for (String segment : path) {
+ value = ((Map, ?>) value).get(segment);
+ }
+ List> values = (List>) value;
+ return values.stream().map(BinaryData::fromObject).collect(Collectors.toList());
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+
+ private String getNextLink(BinaryData binaryData, String... path) {
+ try {
+ Object value = binaryData.toObject(Map.class);
+ for (String segment : path) {
+ value = ((Map, ?>) value).get(segment);
+ }
+ return (String) value;
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateClientImpl.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateClientImpl.java
new file mode 100644
index 000000000000..ad96b556e1c0
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateClientImpl.java
@@ -0,0 +1,144 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.implementation;
+
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.util.serializer.JacksonAdapter;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.iot.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateServiceVersion;
+
+/**
+ * Initializes a new instance of the DeviceRegistrySoftwareUpdateClient type.
+ */
+public final class DeviceRegistrySoftwareUpdateClientImpl {
+ /**
+ * The Software Update for Device Registry account endpoint (hostname only, no protocol).
+ */
+ private final String endpoint;
+
+ /**
+ * Gets The Software Update for Device Registry account endpoint (hostname only, no protocol).
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Service version.
+ */
+ private final DeviceRegistrySoftwareUpdateServiceVersion serviceVersion;
+
+ /**
+ * Gets Service version.
+ *
+ * @return the serviceVersion value.
+ */
+ public DeviceRegistrySoftwareUpdateServiceVersion 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 DeviceClassesImpl object to access its operations.
+ */
+ private final DeviceClassesImpl deviceClasses;
+
+ /**
+ * Gets the DeviceClassesImpl object to access its operations.
+ *
+ * @return the DeviceClassesImpl object.
+ */
+ public DeviceClassesImpl getDeviceClasses() {
+ return this.deviceClasses;
+ }
+
+ /**
+ * The SoftwareUpdatesImpl object to access its operations.
+ */
+ private final SoftwareUpdatesImpl softwareUpdates;
+
+ /**
+ * Gets the SoftwareUpdatesImpl object to access its operations.
+ *
+ * @return the SoftwareUpdatesImpl object.
+ */
+ public SoftwareUpdatesImpl getSoftwareUpdates() {
+ return this.softwareUpdates;
+ }
+
+ /**
+ * Initializes an instance of DeviceRegistrySoftwareUpdateClient client.
+ *
+ * @param endpoint The Software Update for Device Registry account endpoint (hostname only, no protocol).
+ * @param serviceVersion Service version.
+ */
+ public DeviceRegistrySoftwareUpdateClientImpl(String endpoint,
+ DeviceRegistrySoftwareUpdateServiceVersion serviceVersion) {
+ this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(),
+ JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion);
+ }
+
+ /**
+ * Initializes an instance of DeviceRegistrySoftwareUpdateClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param endpoint The Software Update for Device Registry account endpoint (hostname only, no protocol).
+ * @param serviceVersion Service version.
+ */
+ public DeviceRegistrySoftwareUpdateClientImpl(HttpPipeline httpPipeline, String endpoint,
+ DeviceRegistrySoftwareUpdateServiceVersion serviceVersion) {
+ this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion);
+ }
+
+ /**
+ * Initializes an instance of DeviceRegistrySoftwareUpdateClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param endpoint The Software Update for Device Registry account endpoint (hostname only, no protocol).
+ * @param serviceVersion Service version.
+ */
+ public DeviceRegistrySoftwareUpdateClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ String endpoint, DeviceRegistrySoftwareUpdateServiceVersion serviceVersion) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.endpoint = endpoint;
+ this.serviceVersion = serviceVersion;
+ this.deviceClasses = new DeviceClassesImpl(this);
+ this.softwareUpdates = new SoftwareUpdatesImpl(this);
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/SoftwareUpdatesImpl.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/SoftwareUpdatesImpl.java
new file mode 100644
index 000000000000..70fa206ad81b
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/SoftwareUpdatesImpl.java
@@ -0,0 +1,3235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.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.UrlBuilder;
+import com.azure.core.util.polling.DefaultPollingStrategy;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.PollingStrategyOptions;
+import com.azure.core.util.polling.SyncDefaultPollingStrategy;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.core.util.serializer.TypeReference;
+import com.azure.iot.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateServiceVersion;
+import com.azure.iot.deviceregistry.softwareupdate.models.UpdateOperation;
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in SoftwareUpdates.
+ */
+public final class SoftwareUpdatesImpl {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final SoftwareUpdatesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DeviceRegistrySoftwareUpdateClientImpl client;
+
+ /**
+ * Initializes an instance of SoftwareUpdatesImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ SoftwareUpdatesImpl(DeviceRegistrySoftwareUpdateClientImpl client) {
+ this.service
+ = RestProxy.create(SoftwareUpdatesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * Gets Service version.
+ *
+ * @return the serviceVersion value.
+ */
+ public DeviceRegistrySoftwareUpdateServiceVersion getServiceVersion() {
+ return client.getServiceVersion();
+ }
+
+ /**
+ * The interface defining all the services for DeviceRegistrySoftwareUpdateClientSoftwareUpdates to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("https://{endpoint}")
+ @ServiceInterface(name = "DeviceRegistrySoftwareUpdateClientSoftwareUpdates")
+ public interface SoftwareUpdatesService {
+ @Get("/updates")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listUpdates(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listUpdatesSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Post("/updates:import")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> importUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData importUpdateRequest,
+ RequestOptions requestOptions, Context context);
+
+ @Post("/updates:import")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response importUpdateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData importUpdateRequest,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions/{version}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions/{version}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getUpdateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Delete("/updates/providers/{provider}/names/{name}/versions/{version}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> deleteUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, RequestOptions requestOptions,
+ Context context);
+
+ @Delete("/updates/providers/{provider}/names/{name}/versions/{version}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response deleteUpdateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, RequestOptions requestOptions,
+ Context context);
+
+ @Get("/updates/providers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listProviders(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listProvidersSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listNames(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listNamesSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listVersions(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listVersionsSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions/{version}/files")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listFiles(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions/{version}/files")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listFilesSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getFile(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, @PathParam("fileId") String fileId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/updates/providers/{provider}/names/{name}/versions/{version}/files/{fileId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getFileSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("provider") String provider,
+ @PathParam("name") String name, @PathParam("version") String version, @PathParam("fileId") String fileId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/updates/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listOperationStatuses(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listOperationStatusesSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/updates/operations/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getOperationStatus(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/updates/operations/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getOperationStatusSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listUpdatesNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listUpdatesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listProvidersNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listProvidersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listNamesNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listNamesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listVersionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listVersionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listFilesNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listFilesNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listOperationStatusesNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listOperationStatusesNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | search | String | No | Request updates matching a free-text search
+ * expression. |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listUpdatesSinglePageAsync(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listUpdates(this.client.getEndpoint(),
+ this.client.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 Software Update for Device
+ * Registry.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | search | String | No | Request updates matching a free-text search
+ * expression. |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry 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 Software Update for Device
+ * Registry.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | search | String | No | Request updates matching a free-text search
+ * expression. |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listUpdatesSinglePage(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listUpdatesSync(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get a list of all updates that have been imported to Software Update for Device
+ * Registry.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | search | String | No | Request updates matching a free-text search
+ * expression. |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listUpdates(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(() -> listUpdatesSinglePage(requestOptions),
+ nextLink -> listUpdatesNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return update metadata along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> importUpdateWithResponseAsync(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.importUpdate(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ contentType, accept, importUpdateRequest, 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
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return update metadata along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response importUpdateWithResponse(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.importUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ contentType, accept, importUpdateRequest, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of update metadata.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginImportUpdateWithModelAsync(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(1),
+ () -> this.importUpdateWithResponseAsync(importUpdateRequest, requestOptions),
+ new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class));
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of update metadata.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginImportUpdateWithModel(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(1),
+ () -> this.importUpdateWithResponse(importUpdateRequest, requestOptions),
+ new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class));
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of update metadata.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginImportUpdateAsync(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(1),
+ () -> this.importUpdateWithResponseAsync(importUpdateRequest, requestOptions),
+ new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Import new update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * importUpdateInput (Required): [
+ * (Required){
+ * importManifest (Required): {
+ * url: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * friendlyName: String (Optional)
+ * files (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * url: String (Required)
+ * }
+ * ]
+ * }
+ * ]
+ * enableScan: Boolean (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param importUpdateRequest The update to be imported (see schema
+ * https://json.schemastore.org/azure-deviceupdate-import-manifest-5.0.json for
+ * details).
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of update metadata.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginImportUpdate(BinaryData importUpdateRequest,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(1),
+ () -> this.importUpdateWithResponse(importUpdateRequest, requestOptions),
+ new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Get a specific update version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update version along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getUpdateWithResponseAsync(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.getUpdate(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), provider, name, version, accept, requestOptions, context));
+ }
+
+ /**
+ * Get a specific update version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update version along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getUpdateWithResponse(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), provider,
+ name, version, accept, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteUpdateWithResponseAsync(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> service.deleteUpdate(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), provider, name, version, requestOptions, context));
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response deleteUpdateWithResponse(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return service.deleteUpdateSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ provider, name, version, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginDeleteUpdateWithModelAsync(String provider, String name,
+ String version, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(1),
+ () -> this.deleteUpdateWithResponseAsync(provider, name, version, requestOptions),
+ new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class));
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginDeleteUpdateWithModel(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(1),
+ () -> this.deleteUpdateWithResponse(provider, name, version, requestOptions),
+ new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(UpdateOperation.class), TypeReference.createInstance(Void.class));
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginDeleteUpdateAsync(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(1),
+ () -> this.deleteUpdateWithResponseAsync(provider, name, version, requestOptions),
+ new DefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class));
+ }
+
+ /**
+ * Delete a specific update version. This is a long-running-operation; use
+ * Operation-Location response header value to check for operation status.
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginDeleteUpdate(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(1),
+ () -> this.deleteUpdateWithResponse(provider, name, version, requestOptions),
+ new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.client.getHttpPipeline())
+ .setEndpoint("https://{endpoint}".replace("{endpoint}", this.client.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.client.getServiceVersion().getVersion())),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(Void.class));
+ }
+
+ /**
+ * Get a list of all update providers that have been imported to Software Update for
+ * Device Registry.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listProvidersSinglePageAsync(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listProviders(this.client.getEndpoint(),
+ this.client.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 Software Update for
+ * Device Registry.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry 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 Software Update for
+ * Device Registry.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listProvidersSinglePage(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listProvidersSync(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get a list of all update providers that have been imported to Software Update for
+ * Device Registry.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listProviders(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(() -> listProvidersSinglePage(requestOptions),
+ nextLink -> listProvidersNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNamesSinglePageAsync(String provider, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNames(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), provider, accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listNamesAsync(String provider, RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedFlux<>(() -> listNamesSinglePageAsync(provider, requestOptions),
+ nextLink -> listNamesNextSinglePageAsync(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNamesSinglePage(String provider, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listNamesSync(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), provider, accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get a list of all update names that match the specified provider.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listNames(String provider, RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(() -> listNamesSinglePage(provider, requestOptions),
+ nextLink -> listNamesNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name along with {@link PagedResponse}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listVersionsSinglePageAsync(String provider, String name,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listVersions(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), provider, name, accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listVersionsAsync(String provider, String name, RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedFlux<>(() -> listVersionsSinglePageAsync(provider, name, requestOptions),
+ nextLink -> listVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name along with
+ * {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listVersionsSinglePage(String provider, String name,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listVersionsSync(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), provider, name, accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get a list of all update versions that match the specified provider and name.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter updates by isDeployable property. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listVersions(String provider, String name, RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(() -> listVersionsSinglePage(provider, name, requestOptions),
+ nextLink -> listVersionsNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listFilesSinglePageAsync(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listFiles(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), provider, name, version, accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listFilesAsync(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedFlux<>(() -> listFilesSinglePageAsync(provider, name, version, requestOptions),
+ nextLink -> listFilesNextSinglePageAsync(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listFilesSinglePage(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listFilesSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), provider,
+ name, version, accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get a list of all update file identifiers for the specified version.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listFiles(String provider, String name, String version,
+ RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(() -> listFilesSinglePage(provider, name, version, requestOptions),
+ nextLink -> listFilesNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Get a specific update file from the version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * fileId: String (Required)
+ * relatedFiles (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * downloadHandler (Optional): {
+ * id: String (Required)
+ * }
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update file from the version along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getFileWithResponseAsync(String provider, String name, String version,
+ String fileId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.getFile(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ provider, name, version, fileId, accept, requestOptions, context));
+ }
+
+ /**
+ * Get a specific update file from the version.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * fileId: String (Required)
+ * relatedFiles (Optional): [
+ * (Optional){
+ * fileName: String (Required)
+ * sizeInBytes: long (Required)
+ * hashes (Required): {
+ * String: String (Required)
+ * }
+ * mimeType: String (Optional)
+ * scanResult: String (Optional)
+ * scanDetails: String (Optional)
+ * properties (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * downloadHandler (Optional): {
+ * id: String (Required)
+ * }
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param provider Update provider.
+ * @param name Update name.
+ * @param version Update version.
+ * @param fileId File identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a specific update file from the version along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getFileWithResponse(String provider, String name, String version, String fileId,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getFileSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), provider,
+ name, version, fileId, accept, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter operations by status property. Only one
+ * specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'" |
+ * | maxpagesize | Integer | No | Specifies a non-negative integer n that limits the number
+ * of items returned
+ * from a collection. The service returns the number of available items up to but
+ * not greater than the specified value n. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listOperationStatusesSinglePageAsync(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listOperationStatuses(this.client.getEndpoint(),
+ this.client.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
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter operations by status property. Only one
+ * specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'" |
+ * | maxpagesize | Integer | No | Specifies a non-negative integer n that limits the number
+ * of items returned
+ * from a collection. The service returns the number of available items up to but
+ * not greater than the specified value n. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listOperationStatusesAsync(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedFlux<>((pageSize) -> {
+ RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
+ if (pageSize != null) {
+ requestOptionsLocal.addRequestCallback(requestLocal -> {
+ UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
+ urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
+ requestLocal.setUrl(urlBuilder.toString());
+ });
+ }
+ return listOperationStatusesSinglePageAsync(requestOptionsLocal);
+ }, (nextLink, pageSize) -> {
+ RequestOptions requestOptionsLocal = new RequestOptions();
+ requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
+ if (pageSize != null) {
+ requestOptionsLocal.addRequestCallback(requestLocal -> {
+ UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
+ urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
+ requestLocal.setUrl(urlBuilder.toString());
+ });
+ }
+ return listOperationStatusesNextSinglePageAsync(nextLink, requestOptionsLocal);
+ });
+ }
+
+ /**
+ * 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
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter operations by status property. Only one
+ * specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'" |
+ * | maxpagesize | Integer | No | Specifies a non-negative integer n that limits the number
+ * of items returned
+ * from a collection. The service returns the number of available items up to but
+ * not greater than the specified value n. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listOperationStatusesSinglePage(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listOperationStatusesSync(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get a list of all import update operations. Completed operations are kept for 7
+ * days before auto-deleted. Delete operations are not returned by this API
+ * version.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | filter | String | No | Optional to filter operations by status property. Only one
+ * specific filter is
+ * supported: "status eq 'NotStarted' or status eq 'Running'" |
+ * | maxpagesize | Integer | No | Specifies a non-negative integer n that limits the number
+ * of items returned
+ * from a collection. The service returns the number of available items up to but
+ * not greater than the specified value n. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listOperationStatuses(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>((pageSize) -> {
+ RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions;
+ if (pageSize != null) {
+ requestOptionsLocal.addRequestCallback(requestLocal -> {
+ UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
+ urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
+ requestLocal.setUrl(urlBuilder.toString());
+ });
+ }
+ return listOperationStatusesSinglePage(requestOptionsLocal);
+ }, (nextLink, pageSize) -> {
+ RequestOptions requestOptionsLocal = new RequestOptions();
+ requestOptionsLocal.setContext(requestOptionsForNextPage.getContext());
+ if (pageSize != null) {
+ requestOptionsLocal.addRequestCallback(requestLocal -> {
+ UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl());
+ urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize));
+ requestLocal.setUrl(urlBuilder.toString());
+ });
+ }
+ return listOperationStatusesNextSinglePage(nextLink, requestOptionsLocal);
+ });
+ }
+
+ /**
+ * Retrieve operation status.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | Retry-After | String | Number of seconds to wait before checking the operation status
+ * again. |
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return operation metadata along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getOperationStatusWithResponseAsync(String operationId,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.getOperationStatus(this.client.getEndpoint(),
+ this.client.getServiceVersion().getVersion(), operationId, accept, requestOptions, context));
+ }
+
+ /**
+ * Retrieve operation status.
+ * Header Parameters
+ *
+ * Header Parameters
+ * | Name | Type | Required | Description |
+ * | If-None-Match | String | No | Defines the If-None-Match condition. The operation will
+ * be performed only if
+ * the ETag on the server does not match this value. |
+ *
+ * You can add these to a request with {@link RequestOptions#addHeader}
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Headers
+ *
+ * Response Headers
+ * | Name | Type | Description |
+ * | Retry-After | String | Number of seconds to wait before checking the operation status
+ * again. |
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return operation metadata along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getOperationStatusWithResponse(String operationId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getOperationStatusSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(),
+ operationId, accept, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listUpdatesNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.listUpdatesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * isDeployable: Boolean (Optional)
+ * updateType: String (Optional)
+ * installedCriteria: String (Optional)
+ * compatibility (Required): [
+ * (Required){
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * ]
+ * instructions (Optional): {
+ * steps (Required): [
+ * (Required){
+ * type: String(inline/reference) (Optional)
+ * description: String (Optional)
+ * handler: String (Optional)
+ * handlerProperties (Optional): {
+ * String: BinaryData (Required)
+ * }
+ * fileNames (Optional): [
+ * String (Optional)
+ * ]
+ * updateId (Optional): (recursive schema, see updateId above)
+ * }
+ * ]
+ * }
+ * referencedBy (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * scanResult: String (Optional)
+ * manifestVersion: String (Required)
+ * importedDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all updates that have been imported to Software Update for Device
+ * Registry along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listUpdatesNextSinglePage(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listUpdatesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listProvidersNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.listProvidersNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update providers that have been imported to Software Update for
+ * Device Registry along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listProvidersNextSinglePage(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listProvidersNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNamesNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listNamesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update names that match the specified provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNamesNextSinglePage(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listNamesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name along with {@link PagedResponse}
+ * on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listVersionsNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.listVersionsNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update versions that match the specified provider and name along with
+ * {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listVersionsNextSinglePage(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listVersionsNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listFilesNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listFilesNext(nextLink, this.client.getEndpoint(), accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * String
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all update file identifiers for the specified version along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listFilesNextSinglePage(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listFilesNextSync(nextLink, this.client.getEndpoint(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listOperationStatusesNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listOperationStatusesNext(nextLink, this.client.getEndpoint(), accept,
+ requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * operationId: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * update (Optional): {
+ * updateId (Required): {
+ * provider: String (Required)
+ * name: String (Required)
+ * version: String (Required)
+ * }
+ * description: String (Optional)
+ * friendlyName: String (Optional)
+ * }
+ * resourceLocation: String (Optional)
+ * error (Optional): {
+ * error (Required): (recursive schema, see error above)
+ * }
+ * traceId: String (Optional)
+ * lastActionDateTime: OffsetDateTime (Required)
+ * createdDateTime: OffsetDateTime (Required)
+ * etag: String (Optional)
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a list of all import update operations along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listOperationStatusesNextSinglePage(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listOperationStatusesNextSync(nextLink, this.client.getEndpoint(), accept,
+ requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ private List getValues(BinaryData binaryData, String... path) {
+ try {
+ Object value = binaryData.toObject(Map.class);
+ for (String segment : path) {
+ value = ((Map, ?>) value).get(segment);
+ }
+ List> values = (List>) value;
+ return values.stream().map(BinaryData::fromObject).collect(Collectors.toList());
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+
+ private String getNextLink(BinaryData binaryData, String... path) {
+ try {
+ Object value = binaryData.toObject(Map.class);
+ for (String segment : path) {
+ value = ((Map, ?>) value).get(segment);
+ }
+ return (String) value;
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/package-info.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/implementation/package-info.java
new file mode 100644
index 000000000000..bba03fc400fe
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the implementations for DeviceRegistrySoftwareUpdateClient.
+ * Software Update for Device Registry is an Azure service that enables customers to publish updates for their IoT
+ * devices to the cloud, and then deploy that update to their devices (approve updates to groups of devices managed and
+ * provisioned in Device Registry). 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 Software Update for Device Registry handle the updates.
+ */
+package com.azure.iot.deviceregistry.softwareupdate.implementation;
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/BestCompatibleUpdate.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/BestCompatibleUpdate.java
new file mode 100644
index 000000000000..0ba7468e8dc8
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/BestCompatibleUpdate.java
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * The best compatible update for a device class.
+ */
+@Immutable
+public final class BestCompatibleUpdate implements JsonSerializable {
+ /*
+ * The identifier of the best-available compatible update.
+ */
+ @Generated
+ private final UpdateId updateId;
+
+ /**
+ * Creates an instance of BestCompatibleUpdate class.
+ *
+ * @param updateId the updateId value to set.
+ */
+ @Generated
+ private BestCompatibleUpdate(UpdateId updateId) {
+ this.updateId = updateId;
+ }
+
+ /**
+ * Get the updateId property: The identifier of the best-available compatible update.
+ *
+ * @return the updateId value.
+ */
+ @Generated
+ public UpdateId getUpdateId() {
+ return this.updateId;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("updateId", this.updateId);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BestCompatibleUpdate from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BestCompatibleUpdate if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the BestCompatibleUpdate.
+ */
+ @Generated
+ public static BestCompatibleUpdate fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ UpdateId updateId = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("updateId".equals(fieldName)) {
+ updateId = UpdateId.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return new BestCompatibleUpdate(updateId);
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/Compatibility.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/Compatibility.java
new file mode 100644
index 000000000000..8652e7f1651c
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/Compatibility.java
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Key-value pairs representing update compatibility information.
+ */
+@Immutable
+public final class Compatibility implements JsonSerializable {
+ /*
+ * Key-value pairs representing update compatibility information.
+ */
+ @Generated
+ private Map additionalProperties;
+
+ /**
+ * Creates an instance of Compatibility class.
+ */
+ @Generated
+ private Compatibility() {
+ }
+
+ /**
+ * Get the additionalProperties property: Key-value pairs representing update compatibility information.
+ *
+ * @return the additionalProperties value.
+ */
+ @Generated
+ public Map getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ if (additionalProperties != null) {
+ for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
+ jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
+ }
+ }
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of Compatibility from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of Compatibility if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the Compatibility.
+ */
+ @Generated
+ public static Compatibility fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ Compatibility deserializedCompatibility = new Compatibility();
+ Map additionalProperties = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if (additionalProperties == null) {
+ additionalProperties = new LinkedHashMap<>();
+ }
+
+ additionalProperties.put(fieldName, reader.getString());
+ }
+ deserializedCompatibility.additionalProperties = additionalProperties;
+
+ return deserializedCompatibility;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/DeviceClass.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/DeviceClass.java
new file mode 100644
index 000000000000..77345ac56317
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/DeviceClass.java
@@ -0,0 +1,119 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * A device class groups devices that share compatibility properties and agent
+ * profile, allowing the service to determine the best compatible update for them.
+ */
+@Immutable
+public final class DeviceClass implements JsonSerializable {
+ /*
+ * Identifier derived from deviceClassProperties encoded as a 16-character
+ * lowercase hexadecimal string.
+ */
+ @Generated
+ private String deviceClassId;
+
+ /*
+ * The properties that identify this device class.
+ */
+ @Generated
+ private DeviceClassProperties deviceClassProperties;
+
+ /*
+ * The best compatible update for the devices in this class, if any.
+ */
+ @Generated
+ private BestCompatibleUpdate bestCompatibleUpdate;
+
+ /**
+ * Creates an instance of DeviceClass class.
+ */
+ @Generated
+ private DeviceClass() {
+ }
+
+ /**
+ * Get the deviceClassId property: Identifier derived from deviceClassProperties encoded as a 16-character
+ * lowercase hexadecimal string.
+ *
+ * @return the deviceClassId value.
+ */
+ @Generated
+ public String getDeviceClassId() {
+ return this.deviceClassId;
+ }
+
+ /**
+ * Get the deviceClassProperties property: The properties that identify this device class.
+ *
+ * @return the deviceClassProperties value.
+ */
+ @Generated
+ public DeviceClassProperties getDeviceClassProperties() {
+ return this.deviceClassProperties;
+ }
+
+ /**
+ * Get the bestCompatibleUpdate property: The best compatible update for the devices in this class, if any.
+ *
+ * @return the bestCompatibleUpdate value.
+ */
+ @Generated
+ public BestCompatibleUpdate getBestCompatibleUpdate() {
+ return this.bestCompatibleUpdate;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeviceClass from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeviceClass if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DeviceClass.
+ */
+ @Generated
+ public static DeviceClass fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DeviceClass deserializedDeviceClass = new DeviceClass();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("deviceClassId".equals(fieldName)) {
+ deserializedDeviceClass.deviceClassId = reader.getString();
+ } else if ("deviceClassProperties".equals(fieldName)) {
+ deserializedDeviceClass.deviceClassProperties = DeviceClassProperties.fromJson(reader);
+ } else if ("bestCompatibleUpdate".equals(fieldName)) {
+ deserializedDeviceClass.bestCompatibleUpdate = BestCompatibleUpdate.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDeviceClass;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/DeviceClassProperties.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/DeviceClassProperties.java
new file mode 100644
index 000000000000..d55de7fbeb2a
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/DeviceClassProperties.java
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Properties that identify a device class.
+ */
+@Immutable
+public final class DeviceClassProperties implements JsonSerializable {
+ /*
+ * Free-form compatibility properties (e.g. manufacturer, model) used to match
+ * devices. This object can be thought of as a set of key-value pairs where the key
+ * is the name of the compatibility property and the value is the value of the
+ * compatibility property. There will always be at least 1 compat property. At most
+ * 5 entries are allowed.
+ */
+ @Generated
+ private final Map compatProperties;
+
+ /*
+ * The agent profile that devices in this class implement.
+ */
+ @Generated
+ private final int agentProfile;
+
+ /**
+ * Creates an instance of DeviceClassProperties class.
+ *
+ * @param compatProperties the compatProperties value to set.
+ * @param agentProfile the agentProfile value to set.
+ */
+ @Generated
+ private DeviceClassProperties(Map compatProperties, int agentProfile) {
+ this.compatProperties = compatProperties;
+ this.agentProfile = agentProfile;
+ }
+
+ /**
+ * Get the compatProperties property: Free-form compatibility properties (e.g. manufacturer, model) used to match
+ * devices. This object can be thought of as a set of key-value pairs where the key
+ * is the name of the compatibility property and the value is the value of the
+ * compatibility property. There will always be at least 1 compat property. At most
+ * 5 entries are allowed.
+ *
+ * @return the compatProperties value.
+ */
+ @Generated
+ public Map getCompatProperties() {
+ return this.compatProperties;
+ }
+
+ /**
+ * Get the agentProfile property: The agent profile that devices in this class implement.
+ *
+ * @return the agentProfile value.
+ */
+ @Generated
+ public int getAgentProfile() {
+ return this.agentProfile;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeMapField("compatProperties", this.compatProperties,
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeIntField("agentProfile", this.agentProfile);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DeviceClassProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DeviceClassProperties if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the DeviceClassProperties.
+ */
+ @Generated
+ public static DeviceClassProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ Map compatProperties = null;
+ int agentProfile = 0;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("compatProperties".equals(fieldName)) {
+ compatProperties = reader.readMap(reader1 -> reader1.getString());
+ } else if ("agentProfile".equals(fieldName)) {
+ agentProfile = reader.getInt();
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return new DeviceClassProperties(compatProperties, agentProfile);
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/FileImportMetadata.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/FileImportMetadata.java
new file mode 100644
index 000000000000..822ce9cf9b1e
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/FileImportMetadata.java
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Metadata describing an update file.
+ */
+@Immutable
+public final class FileImportMetadata implements JsonSerializable {
+ /*
+ * Update file name as specified inside import manifest.
+ */
+ @Generated
+ private final String fileName;
+
+ /*
+ * Azure Blob location from which the update file can be downloaded by Device
+ * Update for Device Registry. This is typically a read-only SAS-protected blob URL
+ * with an expiration set to at least 4 hours.
+ */
+ @Generated
+ private final String url;
+
+ /**
+ * Creates an instance of FileImportMetadata class.
+ *
+ * @param fileName the fileName value to set.
+ * @param url the url value to set.
+ */
+ @Generated
+ public FileImportMetadata(String fileName, String url) {
+ this.fileName = fileName;
+ this.url = url;
+ }
+
+ /**
+ * Get the fileName property: Update file name as specified inside import manifest.
+ *
+ * @return the fileName value.
+ */
+ @Generated
+ public String getFileName() {
+ return this.fileName;
+ }
+
+ /**
+ * Get the url property: Azure Blob location from which the update file can be downloaded by Device
+ * Update for Device Registry. This is typically a read-only SAS-protected blob URL
+ * with an expiration set to at least 4 hours.
+ *
+ * @return the url value.
+ */
+ @Generated
+ public String getUrl() {
+ return this.url;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("fileName", this.fileName);
+ jsonWriter.writeStringField("url", this.url);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of FileImportMetadata from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of FileImportMetadata if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the FileImportMetadata.
+ */
+ @Generated
+ public static FileImportMetadata fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String fileName = null;
+ String url = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("fileName".equals(fieldName)) {
+ fileName = reader.getString();
+ } else if ("url".equals(fieldName)) {
+ url = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return new FileImportMetadata(fileName, url);
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportManifestMetadata.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportManifestMetadata.java
new file mode 100644
index 000000000000..a9dc10020552
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportManifestMetadata.java
@@ -0,0 +1,139 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Metadata describing the import manifest, a document which describes the files
+ * and other metadata about an update version.
+ */
+@Immutable
+public final class ImportManifestMetadata implements JsonSerializable {
+ /*
+ * Azure Blob location from which the import manifest can be downloaded by Device
+ * Update for Device Registry. This is typically a read-only SAS-protected blob URL
+ * with an expiration set to at least 4 hours.
+ */
+ @Generated
+ private final String url;
+
+ /*
+ * File size in number of bytes.
+ */
+ @Generated
+ private final long sizeInBytes;
+
+ /*
+ * A JSON object containing the hash(es) of the file. At least SHA256 hash is
+ * required. This object can be thought of as a set of key-value pairs where the
+ * key is the hash algorithm, and the value is the hash of the file calculated
+ * using that algorithm.
+ */
+ @Generated
+ private final Map hashes;
+
+ /**
+ * Creates an instance of ImportManifestMetadata class.
+ *
+ * @param url the url value to set.
+ * @param sizeInBytes the sizeInBytes value to set.
+ * @param hashes the hashes value to set.
+ */
+ @Generated
+ public ImportManifestMetadata(String url, long sizeInBytes, Map hashes) {
+ this.url = url;
+ this.sizeInBytes = sizeInBytes;
+ this.hashes = hashes;
+ }
+
+ /**
+ * Get the url property: Azure Blob location from which the import manifest can be downloaded by Device
+ * Update for Device Registry. This is typically a read-only SAS-protected blob URL
+ * with an expiration set to at least 4 hours.
+ *
+ * @return the url value.
+ */
+ @Generated
+ public String getUrl() {
+ return this.url;
+ }
+
+ /**
+ * Get the sizeInBytes property: File size in number of bytes.
+ *
+ * @return the sizeInBytes value.
+ */
+ @Generated
+ public long getSizeInBytes() {
+ return this.sizeInBytes;
+ }
+
+ /**
+ * Get the hashes property: A JSON object containing the hash(es) of the file. At least SHA256 hash is
+ * required. This object can be thought of as a set of key-value pairs where the
+ * key is the hash algorithm, and the value is the hash of the file calculated
+ * using that algorithm.
+ *
+ * @return the hashes value.
+ */
+ @Generated
+ public Map getHashes() {
+ return this.hashes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("url", this.url);
+ jsonWriter.writeLongField("sizeInBytes", this.sizeInBytes);
+ jsonWriter.writeMapField("hashes", this.hashes, (writer, element) -> writer.writeString(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ImportManifestMetadata from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ImportManifestMetadata if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ImportManifestMetadata.
+ */
+ @Generated
+ public static ImportManifestMetadata fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String url = null;
+ long sizeInBytes = 0L;
+ Map hashes = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("url".equals(fieldName)) {
+ url = reader.getString();
+ } else if ("sizeInBytes".equals(fieldName)) {
+ sizeInBytes = reader.getLong();
+ } else if ("hashes".equals(fieldName)) {
+ hashes = reader.readMap(reader1 -> reader1.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return new ImportManifestMetadata(url, sizeInBytes, hashes);
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportUpdateInputItem.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportUpdateInputItem.java
new file mode 100644
index 000000000000..1ce68acd1741
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportUpdateInputItem.java
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Generated;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Import update input item metadata.
+ */
+@Fluent
+public final class ImportUpdateInputItem implements JsonSerializable {
+ /*
+ * Import manifest metadata like source URL, file size/hashes, etc.
+ */
+ @Generated
+ private final ImportManifestMetadata importManifest;
+
+ /*
+ * Friendly update name.
+ */
+ @Generated
+ private String friendlyName;
+
+ /*
+ * One or more update file properties like file name and source URL.
+ */
+ @Generated
+ private List files;
+
+ /**
+ * Creates an instance of ImportUpdateInputItem class.
+ *
+ * @param importManifest the importManifest value to set.
+ */
+ @Generated
+ public ImportUpdateInputItem(ImportManifestMetadata importManifest) {
+ this.importManifest = importManifest;
+ }
+
+ /**
+ * Get the importManifest property: Import manifest metadata like source URL, file size/hashes, etc.
+ *
+ * @return the importManifest value.
+ */
+ @Generated
+ public ImportManifestMetadata getImportManifest() {
+ return this.importManifest;
+ }
+
+ /**
+ * Get the friendlyName property: Friendly update name.
+ *
+ * @return the friendlyName value.
+ */
+ @Generated
+ public String getFriendlyName() {
+ return this.friendlyName;
+ }
+
+ /**
+ * Set the friendlyName property: Friendly update name.
+ *
+ * @param friendlyName the friendlyName value to set.
+ * @return the ImportUpdateInputItem object itself.
+ */
+ @Generated
+ public ImportUpdateInputItem setFriendlyName(String friendlyName) {
+ this.friendlyName = friendlyName;
+ return this;
+ }
+
+ /**
+ * Get the files property: One or more update file properties like file name and source URL.
+ *
+ * @return the files value.
+ */
+ @Generated
+ public List getFiles() {
+ return this.files;
+ }
+
+ /**
+ * Set the files property: One or more update file properties like file name and source URL.
+ *
+ * @param files the files value to set.
+ * @return the ImportUpdateInputItem object itself.
+ */
+ @Generated
+ public ImportUpdateInputItem setFiles(List files) {
+ this.files = files;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("importManifest", this.importManifest);
+ jsonWriter.writeStringField("friendlyName", this.friendlyName);
+ jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ImportUpdateInputItem from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ImportUpdateInputItem if the JsonReader was pointing to an instance of it, or null if it
+ * was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ImportUpdateInputItem.
+ */
+ @Generated
+ public static ImportUpdateInputItem fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ImportManifestMetadata importManifest = null;
+ String friendlyName = null;
+ List files = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("importManifest".equals(fieldName)) {
+ importManifest = ImportManifestMetadata.fromJson(reader);
+ } else if ("friendlyName".equals(fieldName)) {
+ friendlyName = reader.getString();
+ } else if ("files".equals(fieldName)) {
+ files = reader.readArray(reader1 -> FileImportMetadata.fromJson(reader1));
+ } else {
+ reader.skipChildren();
+ }
+ }
+ ImportUpdateInputItem deserializedImportUpdateInputItem = new ImportUpdateInputItem(importManifest);
+ deserializedImportUpdateInputItem.friendlyName = friendlyName;
+ deserializedImportUpdateInputItem.files = files;
+
+ return deserializedImportUpdateInputItem;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportUpdateRequest.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportUpdateRequest.java
new file mode 100644
index 000000000000..63cc20b0fdea
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/ImportUpdateRequest.java
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.Generated;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Import update input metadata.
+ */
+@Fluent
+public final class ImportUpdateRequest implements JsonSerializable {
+ /*
+ * Import update input metadata.
+ */
+ @Generated
+ private final List importUpdateInput;
+
+ /*
+ * Whether to enable anti-malware scan of the imported update payload files.
+ */
+ @Generated
+ private Boolean enableScan;
+
+ /**
+ * Creates an instance of ImportUpdateRequest class.
+ *
+ * @param importUpdateInput the importUpdateInput value to set.
+ */
+ @Generated
+ public ImportUpdateRequest(List importUpdateInput) {
+ this.importUpdateInput = importUpdateInput;
+ }
+
+ /**
+ * Get the importUpdateInput property: Import update input metadata.
+ *
+ * @return the importUpdateInput value.
+ */
+ @Generated
+ public List getImportUpdateInput() {
+ return this.importUpdateInput;
+ }
+
+ /**
+ * Get the enableScan property: Whether to enable anti-malware scan of the imported update payload files.
+ *
+ * @return the enableScan value.
+ */
+ @Generated
+ public Boolean isEnableScan() {
+ return this.enableScan;
+ }
+
+ /**
+ * Set the enableScan property: Whether to enable anti-malware scan of the imported update payload files.
+ *
+ * @param enableScan the enableScan value to set.
+ * @return the ImportUpdateRequest object itself.
+ */
+ @Generated
+ public ImportUpdateRequest setEnableScan(Boolean enableScan) {
+ this.enableScan = enableScan;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("importUpdateInput", this.importUpdateInput,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeBooleanField("enableScan", this.enableScan);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ImportUpdateRequest from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ImportUpdateRequest if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ImportUpdateRequest.
+ */
+ @Generated
+ public static ImportUpdateRequest fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ List importUpdateInput = null;
+ Boolean enableScan = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("importUpdateInput".equals(fieldName)) {
+ importUpdateInput = reader.readArray(reader1 -> ImportUpdateInputItem.fromJson(reader1));
+ } else if ("enableScan".equals(fieldName)) {
+ enableScan = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+ ImportUpdateRequest deserializedImportUpdateRequest = new ImportUpdateRequest(importUpdateInput);
+ deserializedImportUpdateRequest.enableScan = enableScan;
+
+ return deserializedImportUpdateRequest;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/Instructions.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/Instructions.java
new file mode 100644
index 000000000000..75de25d12cc2
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/Instructions.java
@@ -0,0 +1,84 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Update install instructions container.
+ */
+@Immutable
+public final class Instructions implements JsonSerializable {
+ /*
+ * Collection of installation steps.
+ */
+ @Generated
+ private final List steps;
+
+ /**
+ * Creates an instance of Instructions class.
+ *
+ * @param steps the steps value to set.
+ */
+ @Generated
+ private Instructions(List steps) {
+ this.steps = steps;
+ }
+
+ /**
+ * Get the steps property: Collection of installation steps.
+ *
+ * @return the steps value.
+ */
+ @Generated
+ public List getSteps() {
+ return this.steps;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Generated
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("steps", this.steps, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of Instructions from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of Instructions if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the Instructions.
+ */
+ @Generated
+ public static Instructions fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ List steps = null;
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("steps".equals(fieldName)) {
+ steps = reader.readArray(reader1 -> Step.fromJson(reader1));
+ } else {
+ reader.skipChildren();
+ }
+ }
+ return new Instructions(steps);
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/OperationState.java b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/OperationState.java
new file mode 100644
index 000000000000..ae3f1dae1b2d
--- /dev/null
+++ b/sdk/deviceregistry/azure-iot-deviceregistry-softwareupdate/src/main/java/com/azure/iot/deviceregistry/softwareupdate/models/OperationState.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.iot.deviceregistry.softwareupdate.models;
+
+import com.azure.core.annotation.Generated;
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Enum describing allowed operation states.
+ */
+public final class OperationState extends ExpandableStringEnum {
+ /**
+ * The operation has not started.
+ */
+ @Generated
+ public static final OperationState NOT_STARTED = fromString("NotStarted");
+
+ /**
+ * The operation is in progress.
+ */
+ @Generated
+ public static final OperationState RUNNING = fromString("Running");
+
+ /**
+ * The operation has completed successfully.
+ */
+ @Generated
+ public static final OperationState SUCCEEDED = fromString("Succeeded");
+
+ /**
+ * The operation has failed.
+ */
+ @Generated
+ public static final OperationState FAILED = fromString("Failed");
+
+ /**
+ * The operation has been canceled by the user.
+ */
+ @Generated
+ public static final OperationState CANCELED = fromString("Canceled");
+
+ /**
+ * Creates a new instance of OperationState value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Generated
+ @Deprecated
+ public OperationState() {
+ }
+
+ /**
+ * Creates or finds a OperationState from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding OperationState.
+ */
+ @Generated
+ public static OperationState fromString(String name) {
+ return fromString(name, OperationState.class);
+ }
+
+ /**
+ * Gets known OperationState values.
+ *
+ * @return known OperationState values.
+ */
+ @Generated
+ public static Collection