scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Adds the scope to permission sets.
+ *
+ * @param scope the scope.
+ * @return the configurable object itself.
+ */
+ public Configurable withScope(String scope) {
+ this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval
+ = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of Device Registry Software Update service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Device Registry Software Update service API instance.
+ */
+ public DeviceRegistrySoftwareUpdateManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder.append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.deviceregistry.softwareupdate")
+ .append("/")
+ .append(clientVersion);
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder.append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ policies.add(new RequestIdPolicy());
+ policies.addAll(this.policies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies.addAll(this.policies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new DeviceRegistrySoftwareUpdateManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /**
+ * Gets the resource collection API of UpdateInstances. It manages UpdateInstance.
+ *
+ * @return Resource collection API of UpdateInstances.
+ */
+ public UpdateInstances updateInstances() {
+ if (this.updateInstances == null) {
+ this.updateInstances = new UpdateInstancesImpl(clientObject.getUpdateInstances(), this);
+ }
+ return updateInstances;
+ }
+
+ /**
+ * Gets wrapped service client DeviceRegistrySoftwareUpdateManagementClient providing direct access to the
+ * underlying auto-generated API implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client DeviceRegistrySoftwareUpdateManagementClient.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/DeviceRegistrySoftwareUpdateManagementClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/DeviceRegistrySoftwareUpdateManagementClient.java
new file mode 100644
index 0000000000000..5882d9f548130
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/DeviceRegistrySoftwareUpdateManagementClient.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for DeviceRegistrySoftwareUpdateManagementClient class.
+ */
+public interface DeviceRegistrySoftwareUpdateManagementClient {
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the UpdateInstancesClient object to access its operations.
+ *
+ * @return the UpdateInstancesClient object.
+ */
+ UpdateInstancesClient getUpdateInstances();
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/OperationsClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..4a204dfb6ffd3
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/OperationsClient.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.resourcemanager.deviceregistry.softwareupdate.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.OperationInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public interface OperationsClient {
+ /**
+ * List the operations for the provider.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/UpdateInstancesClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/UpdateInstancesClient.java
new file mode 100644
index 0000000000000..de636854b6a71
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/UpdateInstancesClient.java
@@ -0,0 +1,326 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.UpdateInstanceInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstanceUpdate;
+
+/**
+ * An instance of this class provides access to all the operations defined in UpdateInstancesClient.
+ */
+public interface UpdateInstancesClient {
+ /**
+ * Returns update instance details for the given update instance name.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String updateInstanceName,
+ Context context);
+
+ /**
+ * Returns update instance details for the given update instance name.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ UpdateInstanceInner getByResourceGroup(String resourceGroupName, String updateInstanceName);
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, UpdateInstanceInner> beginCreate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceInner resource);
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, UpdateInstanceInner> beginCreate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceInner resource, Context context);
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ UpdateInstanceInner create(String resourceGroupName, String updateInstanceName, UpdateInstanceInner resource);
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ UpdateInstanceInner create(String resourceGroupName, String updateInstanceName, UpdateInstanceInner resource,
+ Context context);
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, UpdateInstanceInner> beginUpdate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceUpdate properties);
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, UpdateInstanceInner> beginUpdate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceUpdate properties, Context context);
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ UpdateInstanceInner update(String resourceGroupName, String updateInstanceName, UpdateInstanceUpdate properties);
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ UpdateInstanceInner update(String resourceGroupName, String updateInstanceName, UpdateInstanceUpdate properties,
+ Context context);
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String updateInstanceName);
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String updateInstanceName,
+ Context context);
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String updateInstanceName);
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String updateInstanceName, Context context);
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Check if the Update Instance name is available.
+ *
+ * @param body The CheckAvailability request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body,
+ Context context);
+
+ /**
+ * Check if the Update Instance name is available.
+ *
+ * @param body The CheckAvailability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailabilityRequest body);
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/AccountLinkingInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/AccountLinkingInner.java
new file mode 100644
index 0000000000000..d7c7ab6c92443
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/AccountLinkingInner.java
@@ -0,0 +1,96 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models;
+
+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 com.azure.resourcemanager.deviceregistry.softwareupdate.models.AccountLinkingState;
+import java.io.IOException;
+
+/**
+ * Account linking information. Present only after the first /link/initiate.
+ */
+@Immutable
+public final class AccountLinkingInner implements JsonSerializable {
+ /*
+ * The ARM resource ID of the linked Azure Device Registry namespace.
+ */
+ private String namespaceResourceId;
+
+ /*
+ * The current linking state. Absent before any link attempt (logical NotLinked state).
+ * See AccountLinkingState for the full state machine and transition rules.
+ */
+ private AccountLinkingState linkingState;
+
+ /**
+ * Creates an instance of AccountLinkingInner class.
+ */
+ private AccountLinkingInner() {
+ }
+
+ /**
+ * Get the namespaceResourceId property: The ARM resource ID of the linked Azure Device Registry namespace.
+ *
+ * @return the namespaceResourceId value.
+ */
+ public String namespaceResourceId() {
+ return this.namespaceResourceId;
+ }
+
+ /**
+ * Get the linkingState property: The current linking state. Absent before any link attempt (logical NotLinked
+ * state).
+ * See AccountLinkingState for the full state machine and transition rules.
+ *
+ * @return the linkingState value.
+ */
+ public AccountLinkingState linkingState() {
+ return this.linkingState;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("namespaceResourceId", this.namespaceResourceId);
+ jsonWriter.writeStringField("linkingState", this.linkingState == null ? null : this.linkingState.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AccountLinkingInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AccountLinkingInner 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 AccountLinkingInner.
+ */
+ public static AccountLinkingInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AccountLinkingInner deserializedAccountLinkingInner = new AccountLinkingInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("namespaceResourceId".equals(fieldName)) {
+ deserializedAccountLinkingInner.namespaceResourceId = reader.getString();
+ } else if ("linkingState".equals(fieldName)) {
+ deserializedAccountLinkingInner.linkingState = AccountLinkingState.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAccountLinkingInner;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/CheckNameAvailabilityResultInner.java
new file mode 100644
index 0000000000000..cc50db4406b3c
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/CheckNameAvailabilityResultInner.java
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models;
+
+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 com.azure.resourcemanager.deviceregistry.softwareupdate.models.CheckNameAvailabilityReason;
+import java.io.IOException;
+
+/**
+ * The check availability result.
+ */
+@Immutable
+public final class CheckNameAvailabilityResultInner implements JsonSerializable {
+ /*
+ * Indicates if the resource name is available.
+ */
+ private Boolean nameAvailable;
+
+ /*
+ * The reason why the given name is not available.
+ */
+ private CheckNameAvailabilityReason reason;
+
+ /*
+ * Detailed reason why the given name is not available.
+ */
+ private String message;
+
+ /**
+ * Creates an instance of CheckNameAvailabilityResultInner class.
+ */
+ private CheckNameAvailabilityResultInner() {
+ }
+
+ /**
+ * Get the nameAvailable property: Indicates if the resource name is available.
+ *
+ * @return the nameAvailable value.
+ */
+ public Boolean nameAvailable() {
+ return this.nameAvailable;
+ }
+
+ /**
+ * Get the reason property: The reason why the given name is not available.
+ *
+ * @return the reason value.
+ */
+ public CheckNameAvailabilityReason reason() {
+ return this.reason;
+ }
+
+ /**
+ * Get the message property: Detailed reason why the given name is not available.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable);
+ jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString());
+ jsonWriter.writeStringField("message", this.message);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of CheckNameAvailabilityResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of CheckNameAvailabilityResultInner 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 CheckNameAvailabilityResultInner.
+ */
+ public static CheckNameAvailabilityResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ CheckNameAvailabilityResultInner deserializedCheckNameAvailabilityResultInner
+ = new CheckNameAvailabilityResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("nameAvailable".equals(fieldName)) {
+ deserializedCheckNameAvailabilityResultInner.nameAvailable
+ = reader.getNullable(JsonReader::getBoolean);
+ } else if ("reason".equals(fieldName)) {
+ deserializedCheckNameAvailabilityResultInner.reason
+ = CheckNameAvailabilityReason.fromString(reader.getString());
+ } else if ("message".equals(fieldName)) {
+ deserializedCheckNameAvailabilityResultInner.message = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedCheckNameAvailabilityResultInner;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/OperationInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/OperationInner.java
new file mode 100644
index 0000000000000..9813e49e911d6
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/OperationInner.java
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models;
+
+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 com.azure.resourcemanager.deviceregistry.softwareupdate.models.ActionType;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.OperationDisplay;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.Origin;
+import java.io.IOException;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Immutable
+public final class OperationInner implements JsonSerializable {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
+ * Resource Manager/control-plane operations.
+ */
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ private OperationDisplay display;
+
+ /*
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ * value is "user,system"
+ */
+ private Origin origin;
+
+ /*
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ private OperationInner() {
+ }
+
+ /**
+ * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for Azure Resource Manager/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ public Origin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are
+ * for internal only APIs.
+ *
+ * @return the actionType value.
+ */
+ public ActionType actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("display", this.display);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationInner 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 OperationInner.
+ */
+ public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationInner deserializedOperationInner = new OperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationInner.name = reader.getString();
+ } else if ("isDataAction".equals(fieldName)) {
+ deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationInner.display = OperationDisplay.fromJson(reader);
+ } else if ("origin".equals(fieldName)) {
+ deserializedOperationInner.origin = Origin.fromString(reader.getString());
+ } else if ("actionType".equals(fieldName)) {
+ deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationInner;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/UpdateInstanceInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/UpdateInstanceInner.java
new file mode 100644
index 0000000000000..912b198258ed2
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/UpdateInstanceInner.java
@@ -0,0 +1,209 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.ManagedServiceIdentity;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Device Update instance details.
+ */
+@Fluent
+public final class UpdateInstanceInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private UpdateInstancePropertiesInner properties;
+
+ /*
+ * The managed service identities assigned to this resource.
+ */
+ private ManagedServiceIdentity identity;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of UpdateInstanceInner class.
+ */
+ public UpdateInstanceInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public UpdateInstancePropertiesInner properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the UpdateInstanceInner object itself.
+ */
+ public UpdateInstanceInner withProperties(UpdateInstancePropertiesInner properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the identity property: The managed service identities assigned to this resource.
+ *
+ * @return the identity value.
+ */
+ public ManagedServiceIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The managed service identities assigned to this resource.
+ *
+ * @param identity the identity value to set.
+ * @return the UpdateInstanceInner object itself.
+ */
+ public UpdateInstanceInner withIdentity(ManagedServiceIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public UpdateInstanceInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public UpdateInstanceInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ jsonWriter.writeJsonField("identity", this.identity);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of UpdateInstanceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of UpdateInstanceInner 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 UpdateInstanceInner.
+ */
+ public static UpdateInstanceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ UpdateInstanceInner deserializedUpdateInstanceInner = new UpdateInstanceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedUpdateInstanceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedUpdateInstanceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedUpdateInstanceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedUpdateInstanceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedUpdateInstanceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedUpdateInstanceInner.properties = UpdateInstancePropertiesInner.fromJson(reader);
+ } else if ("identity".equals(fieldName)) {
+ deserializedUpdateInstanceInner.identity = ManagedServiceIdentity.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedUpdateInstanceInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedUpdateInstanceInner;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/UpdateInstancePropertiesInner.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/UpdateInstancePropertiesInner.java
new file mode 100644
index 0000000000000..0e154d1620961
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/UpdateInstancePropertiesInner.java
@@ -0,0 +1,111 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models;
+
+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 com.azure.resourcemanager.deviceregistry.softwareupdate.models.ProvisioningState;
+import java.io.IOException;
+
+/**
+ * Update Instance properties.
+ *
+ * All properties are read-only because resource state is managed exclusively
+ * through the internal link* action endpoints.
+ */
+@Immutable
+public final class UpdateInstancePropertiesInner implements JsonSerializable {
+ /*
+ * Provisioning state.
+ */
+ private ProvisioningState provisioningState;
+
+ /*
+ * Service-facing address for ADR→ADU communication.
+ */
+ private String serviceAddress;
+
+ /*
+ * Account linking state. Absent until first /link/initiate.
+ */
+ private AccountLinkingInner linking;
+
+ /**
+ * Creates an instance of UpdateInstancePropertiesInner class.
+ */
+ public UpdateInstancePropertiesInner() {
+ }
+
+ /**
+ * Get the provisioningState property: Provisioning state.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the serviceAddress property: Service-facing address for ADR→ADU communication.
+ *
+ * @return the serviceAddress value.
+ */
+ public String serviceAddress() {
+ return this.serviceAddress;
+ }
+
+ /**
+ * Get the linking property: Account linking state. Absent until first /link/initiate.
+ *
+ * @return the linking value.
+ */
+ public AccountLinkingInner linking() {
+ return this.linking;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of UpdateInstancePropertiesInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of UpdateInstancePropertiesInner 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 UpdateInstancePropertiesInner.
+ */
+ public static UpdateInstancePropertiesInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ UpdateInstancePropertiesInner deserializedUpdateInstancePropertiesInner
+ = new UpdateInstancePropertiesInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("provisioningState".equals(fieldName)) {
+ deserializedUpdateInstancePropertiesInner.provisioningState
+ = ProvisioningState.fromString(reader.getString());
+ } else if ("serviceAddress".equals(fieldName)) {
+ deserializedUpdateInstancePropertiesInner.serviceAddress = reader.getString();
+ } else if ("linking".equals(fieldName)) {
+ deserializedUpdateInstancePropertiesInner.linking = AccountLinkingInner.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedUpdateInstancePropertiesInner;
+ });
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/package-info.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/package-info.java
new file mode 100644
index 0000000000000..e23f1d6f14316
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/models/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the inner data models for DeviceRegistrySoftwareUpdate.
+ * Microsoft Device Update resource provider.
+ */
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models;
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/package-info.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/package-info.java
new file mode 100644
index 0000000000000..4c08e2979f253
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/fluent/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the service clients for DeviceRegistrySoftwareUpdate.
+ * Microsoft Device Update resource provider.
+ */
+package com.azure.resourcemanager.deviceregistry.softwareupdate.fluent;
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/AccountLinkingImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/AccountLinkingImpl.java
new file mode 100644
index 0000000000000..e623e7580afed
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/AccountLinkingImpl.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.AccountLinkingInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.AccountLinking;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.AccountLinkingState;
+
+public final class AccountLinkingImpl implements AccountLinking {
+ private AccountLinkingInner innerObject;
+
+ private final com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager;
+
+ AccountLinkingImpl(AccountLinkingInner innerObject,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String namespaceResourceId() {
+ return this.innerModel().namespaceResourceId();
+ }
+
+ public AccountLinkingState linkingState() {
+ return this.innerModel().linkingState();
+ }
+
+ public AccountLinkingInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/CheckNameAvailabilityResultImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/CheckNameAvailabilityResultImpl.java
new file mode 100644
index 0000000000000..5d362e29a3941
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/CheckNameAvailabilityResultImpl.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.CheckNameAvailabilityReason;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.CheckNameAvailabilityResult;
+
+public final class CheckNameAvailabilityResultImpl implements CheckNameAvailabilityResult {
+ private CheckNameAvailabilityResultInner innerObject;
+
+ private final com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager;
+
+ CheckNameAvailabilityResultImpl(CheckNameAvailabilityResultInner innerObject,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public Boolean nameAvailable() {
+ return this.innerModel().nameAvailable();
+ }
+
+ public CheckNameAvailabilityReason reason() {
+ return this.innerModel().reason();
+ }
+
+ public String message() {
+ return this.innerModel().message();
+ }
+
+ public CheckNameAvailabilityResultInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateManagementClientBuilder.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateManagementClientBuilder.java
new file mode 100644
index 0000000000000..e7bf39e211edf
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateManagementClientBuilder.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.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+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.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/**
+ * A builder for creating a new instance of the DeviceRegistrySoftwareUpdateManagementClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { DeviceRegistrySoftwareUpdateManagementClientImpl.class })
+public final class DeviceRegistrySoftwareUpdateManagementClientBuilder {
+ /*
+ * Service host
+ */
+ private String endpoint;
+
+ /**
+ * Sets Service host.
+ *
+ * @param endpoint the endpoint value.
+ * @return the DeviceRegistrySoftwareUpdateManagementClientBuilder.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription. The value must be an UUID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the DeviceRegistrySoftwareUpdateManagementClientBuilder.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the DeviceRegistrySoftwareUpdateManagementClientBuilder.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClientBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the DeviceRegistrySoftwareUpdateManagementClientBuilder.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the DeviceRegistrySoftwareUpdateManagementClientBuilder.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the DeviceRegistrySoftwareUpdateManagementClientBuilder.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of DeviceRegistrySoftwareUpdateManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of DeviceRegistrySoftwareUpdateManagementClientImpl.
+ */
+ public DeviceRegistrySoftwareUpdateManagementClientImpl buildClient() {
+ String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
+ AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
+ HttpPipeline localPipeline = (pipeline != null)
+ ? pipeline
+ : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ Duration localDefaultPollInterval
+ = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
+ SerializerAdapter localSerializerAdapter = (serializerAdapter != null)
+ ? serializerAdapter
+ : SerializerFactory.createDefaultManagementSerializerAdapter();
+ DeviceRegistrySoftwareUpdateManagementClientImpl client
+ = new DeviceRegistrySoftwareUpdateManagementClientImpl(localPipeline, localSerializerAdapter,
+ localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId);
+ return client;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateManagementClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateManagementClientImpl.java
new file mode 100644
index 0000000000000..b5dbd331622cb
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/DeviceRegistrySoftwareUpdateManagementClientImpl.java
@@ -0,0 +1,351 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.management.polling.SyncPollerFactory;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollResponse;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.DeviceRegistrySoftwareUpdateManagementClient;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.OperationsClient;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.UpdateInstancesClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the DeviceRegistrySoftwareUpdateManagementClientImpl type.
+ */
+@ServiceClient(builder = DeviceRegistrySoftwareUpdateManagementClientBuilder.class)
+public final class DeviceRegistrySoftwareUpdateManagementClientImpl
+ implements DeviceRegistrySoftwareUpdateManagementClient {
+ /**
+ * Service host.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Version parameter.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * 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.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /**
+ * The default poll interval for long-running operation.
+ */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /**
+ * The OperationsClient object to access its operations.
+ */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /**
+ * The UpdateInstancesClient object to access its operations.
+ */
+ private final UpdateInstancesClient updateInstances;
+
+ /**
+ * Gets the UpdateInstancesClient object to access its operations.
+ *
+ * @return the UpdateInstancesClient object.
+ */
+ public UpdateInstancesClient getUpdateInstances() {
+ return this.updateInstances;
+ }
+
+ /**
+ * Initializes an instance of DeviceRegistrySoftwareUpdateManagementClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param endpoint Service host.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ */
+ DeviceRegistrySoftwareUpdateManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.endpoint = endpoint;
+ this.subscriptionId = subscriptionId;
+ this.apiVersion = "2026-11-02-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.updateInstances = new UpdateInstancesClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(Mono>> activationResponse,
+ HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) {
+ return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
+ defaultPollInterval, activationResponse, context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return SyncPoller for poll result and final result.
+ */
+ public SyncPoller, U> getLroResult(Response activationResponse,
+ Type pollResultType, Type finalResultType, Context context) {
+ return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
+ defaultPollInterval, () -> activationResponse, context);
+ }
+
+ /**
+ * Waits for completion and gets the final result, or throws an error.
+ *
+ * @param poller the synchronous poller.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result.
+ * @throws ManagementException if the long running operation fails.
+ */
+ public U getLroFinalResultOrError(SyncPoller, U> poller) {
+ PollResponse> response = poller.waitForCompletion();
+ ManagementException exception = getLroException(response.getStatus(), response.getValue());
+ if (exception != null) {
+ throw exception;
+ }
+ return poller.getFinalResult();
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ ManagementException exception = getLroException(response.getStatus(), response.getValue());
+ if (exception != null) {
+ return Mono.error(exception);
+ }
+ return response.getFinalResult();
+ }
+
+ private ManagementException getLroException(LongRunningOperationStatus status, PollResult> result) {
+ PollResult.Error lroError = result == null ? null : result.getError();
+ if (status != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED || lroError != null) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ if (lroError != null) {
+ errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(),
+ lroError.getResponseBody());
+
+ errorMessage = lroError.getMessage();
+ String errorBody = lroError.getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError = this.getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(status.toString(), errorMessage);
+ }
+ return new ManagementException(errorMessage, errorResponse, managementError);
+ }
+ return null;
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(HttpHeaderName.fromString(s));
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DeviceRegistrySoftwareUpdateManagementClientImpl.class);
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationImpl.java
new file mode 100644
index 0000000000000..568d957c40eb2
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.OperationInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.ActionType;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.Operation;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.OperationDisplay;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager;
+
+ OperationImpl(OperationInner innerObject,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public Origin origin() {
+ return this.innerModel().origin();
+ }
+
+ public ActionType actionType() {
+ return this.innerModel().actionType();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationsClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..6c0c0666785e0
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationsClientImpl.java
@@ -0,0 +1,218 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+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.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.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.OperationsClient;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.OperationInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.implementation.models.OperationListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public final class OperationsClientImpl implements OperationsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final OperationsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DeviceRegistrySoftwareUpdateManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(DeviceRegistrySoftwareUpdateManagementClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DeviceRegistrySoftwareUpdateManagementClientOperations to be used by
+ * the proxy service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DeviceRegistrySoftwareUpdateManagementClientOperations")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.DeviceUpdate/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.DeviceUpdate/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage() {
+ return listSinglePage(Context.NONE);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(Context context) {
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return list(Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ return listNextSinglePage(nextLink, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
+ final String accept = "application/json";
+ Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationsImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..496099be96d43
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/OperationsImpl.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.OperationsClient;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.OperationInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.Operation;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.Operations;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ return this.list(Context.NONE);
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/ResourceManagerUtils.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/ResourceManagerUtils.java
new file mode 100644
index 0000000000000..a270cff190777
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/ResourceManagerUtils.java
@@ -0,0 +1,188 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+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.util.logging.ClientLogger;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class ResourceManagerUtils {
+ private ResourceManagerUtils() {
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null || parameterName == null) {
+ return null;
+ }
+ String[] idSegments = id.split("/", -1);
+ String[] pathSegments = pathTemplate.split("/", -1);
+ int idStart = idSegments[0].isEmpty() ? 1 : 0;
+ int pathStart = pathSegments[0].isEmpty() ? 1 : 0;
+ if (idStart == idSegments.length || pathStart == pathSegments.length) {
+ return null;
+ }
+ for (int i = idStart; i < idSegments.length; ++i) {
+ if (idSegments[i].isEmpty()) {
+ return null;
+ }
+ }
+ String parameterPlaceholder = "{" + parameterName + "}";
+ String value = null;
+ int idIndex = idSegments.length - 1;
+ for (int pathIndex = pathSegments.length - 1; pathIndex >= pathStart; --pathIndex, --idIndex) {
+ String pathSegment = pathSegments[pathIndex];
+ boolean isParameter = pathSegment.startsWith("{") && pathSegment.endsWith("}");
+ if (pathIndex == pathStart && isParameter) {
+ // A leading scope can span multiple segments, or be empty for tenant resources.
+ if (pathSegment.equalsIgnoreCase(parameterPlaceholder)) {
+ value = String.join("/", Arrays.copyOfRange(idSegments, idStart, idIndex + 1));
+ }
+ idIndex = idStart;
+ } else if (idIndex < idStart) {
+ return null;
+ } else if (!isParameter && !pathSegment.equalsIgnoreCase(idSegments[idIndex])) {
+ return null;
+ } else if (pathSegment.equalsIgnoreCase(parameterPlaceholder)) {
+ value = idSegments[idIndex];
+ }
+ }
+ return idIndex < idStart ? value : null;
+ }
+
+ static String getRequiredValueFromIdByParameterName(String id, String pathTemplate, String parameterName,
+ String segmentName, ClientLogger logger) {
+ String value = getValueFromIdByParameterName(id, pathTemplate, parameterName);
+ if (value == null) {
+ throw logger.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment '%s'.", id, segmentName)));
+ }
+ return value;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl<>(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux
+ .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(iterable.iterator(), mapper);
+ }
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstanceImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstanceImpl.java
new file mode 100644
index 0000000000000..c0b7bbcb8e9fe
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstanceImpl.java
@@ -0,0 +1,193 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.UpdateInstanceInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.UpdateInstancePropertiesInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstance;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstanceProperties;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstanceUpdate;
+import java.util.Collections;
+import java.util.Map;
+
+public final class UpdateInstanceImpl implements UpdateInstance, UpdateInstance.Definition, UpdateInstance.Update {
+ private UpdateInstanceInner innerObject;
+
+ private final com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public UpdateInstanceProperties properties() {
+ UpdateInstancePropertiesInner inner = this.innerModel().properties();
+ if (inner != null) {
+ return new UpdateInstancePropertiesImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public ManagedServiceIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public UpdateInstanceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String updateInstanceName;
+
+ private UpdateInstanceUpdate updateProperties;
+
+ public UpdateInstanceImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public UpdateInstance create() {
+ return this.create(Context.NONE);
+ }
+
+ public UpdateInstance create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getUpdateInstances()
+ .create(resourceGroupName, updateInstanceName, this.innerModel(), context);
+ return this;
+ }
+
+ UpdateInstanceImpl(String name,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerObject = new UpdateInstanceInner();
+ this.serviceManager = serviceManager;
+ this.updateInstanceName = name;
+ }
+
+ public UpdateInstanceImpl update() {
+ this.updateProperties = new UpdateInstanceUpdate();
+ return this;
+ }
+
+ public UpdateInstance apply() {
+ return this.apply(Context.NONE);
+ }
+
+ public UpdateInstance apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getUpdateInstances()
+ .update(resourceGroupName, updateInstanceName, updateProperties, context);
+ return this;
+ }
+
+ UpdateInstanceImpl(UpdateInstanceInner innerObject,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(),
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}",
+ "resourceGroupName");
+ this.updateInstanceName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(),
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}",
+ "updateInstanceName");
+ }
+
+ public UpdateInstance refresh() {
+ return this.refresh(Context.NONE);
+ }
+
+ public UpdateInstance refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getUpdateInstances()
+ .getByResourceGroupWithResponse(resourceGroupName, updateInstanceName, context)
+ .getValue();
+ return this;
+ }
+
+ public UpdateInstanceImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public UpdateInstanceImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public UpdateInstanceImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateProperties.withTags(tags);
+ return this;
+ }
+ }
+
+ public UpdateInstanceImpl withProperties(UpdateInstancePropertiesInner properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+
+ public UpdateInstanceImpl withIdentity(ManagedServiceIdentity identity) {
+ if (isInCreateMode()) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ } else {
+ this.updateProperties.withIdentity(identity);
+ return this;
+ }
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel() == null || this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancePropertiesImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancePropertiesImpl.java
new file mode 100644
index 0000000000000..f140cb7011ad0
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancePropertiesImpl.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.AccountLinkingInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.UpdateInstancePropertiesInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.AccountLinking;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.ProvisioningState;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstanceProperties;
+
+public final class UpdateInstancePropertiesImpl implements UpdateInstanceProperties {
+ private UpdateInstancePropertiesInner innerObject;
+
+ private final com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager;
+
+ UpdateInstancePropertiesImpl(UpdateInstancePropertiesInner innerObject,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public String serviceAddress() {
+ return this.innerModel().serviceAddress();
+ }
+
+ public AccountLinking linking() {
+ AccountLinkingInner inner = this.innerModel().linking();
+ if (inner != null) {
+ return new AccountLinkingImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public UpdateInstancePropertiesInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancesClientImpl.java
new file mode 100644
index 0000000000000..ee9fe09ee8cc9
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancesClientImpl.java
@@ -0,0 +1,1735 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.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.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.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.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.UpdateInstancesClient;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.UpdateInstanceInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.implementation.models.LinkInitiateRequest;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.implementation.models.LinkNotifyRequest;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.implementation.models.LinkPreflightRequest;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.implementation.models.LinkPreflightResponse;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.implementation.models.LinkUpdateRequest;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.implementation.models.UpdateInstanceListResult;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstanceUpdate;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in UpdateInstancesClient.
+ */
+public final class UpdateInstancesClientImpl implements UpdateInstancesClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final UpdateInstancesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DeviceRegistrySoftwareUpdateManagementClientImpl client;
+
+ /**
+ * Initializes an instance of UpdateInstancesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ UpdateInstancesClientImpl(DeviceRegistrySoftwareUpdateManagementClientImpl client) {
+ this.service
+ = RestProxy.create(UpdateInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DeviceRegistrySoftwareUpdateManagementClientUpdateInstances to be
+ * used by the proxy service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DeviceRegistrySoftwareUpdateManagementClientUpdateInstances")
+ public interface UpdateInstancesService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getByResourceGroupSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateInstanceInner resource,
+ Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response createSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateInstanceInner resource,
+ Context context);
+
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateInstanceUpdate properties,
+ Context context);
+
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response updateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") UpdateInstanceUpdate properties,
+ Context context);
+
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, Context context);
+
+ @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response deleteSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByResourceGroupSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/updateInstances")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/updateInstances")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/checkNameAvailability")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> checkNameAvailability(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") CheckNameAvailabilityRequest body, Context context);
+
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/checkNameAvailability")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") CheckNameAvailabilityRequest body, Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkPreflight")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> linkPreflight(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkPreflightRequest body,
+ Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkPreflight")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response linkPreflightSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkPreflightRequest body,
+ Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkInitiate")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> linkInitiate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkInitiateRequest body,
+ Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkInitiate")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response linkInitiateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkInitiateRequest body,
+ Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkNotify")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> linkNotify(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkNotifyRequest body,
+ Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkNotify")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response linkNotifySync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkNotifyRequest body,
+ Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkUpdate")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> linkUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkUpdateRequest body,
+ Context context);
+
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/updateInstances/{updateInstanceName}/linkUpdate")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response linkUpdateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("updateInstanceName") String updateInstanceName, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept, @BodyParam("application/json") LinkUpdateRequest body,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByResourceGroupNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listBySubscriptionNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Returns update instance details for the given update instance name.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String updateInstanceName) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns update instance details for the given update instance name.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String updateInstanceName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, updateInstanceName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(String resourceGroupName,
+ String updateInstanceName, Context context) {
+ final String accept = "application/json";
+ return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, accept, context);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateInstanceInner getByResourceGroup(String resourceGroupName, String updateInstanceName) {
+ return getByResourceGroupWithResponse(resourceGroupName, updateInstanceName, Context.NONE).getValue();
+ }
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createWithResponseAsync(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceInner resource) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, resource,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response createWithResponse(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceInner resource) {
+ return createWithResponse(resourceGroupName, updateInstanceName, resource, Context.NONE);
+ }
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response createWithResponse(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceInner resource, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, resource,
+ context);
+ }
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, UpdateInstanceInner> beginCreateAsync(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceInner resource) {
+ Mono>> mono
+ = createWithResponseAsync(resourceGroupName, updateInstanceName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ UpdateInstanceInner.class, UpdateInstanceInner.class, this.client.getContext());
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, UpdateInstanceInner> beginCreate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceInner resource) {
+ return beginCreate(resourceGroupName, updateInstanceName, resource, Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, UpdateInstanceInner> beginCreate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceInner resource, Context context) {
+ Response response = createWithResponse(resourceGroupName, updateInstanceName, resource, context);
+ return this.client.getLroResult(response, UpdateInstanceInner.class,
+ UpdateInstanceInner.class, context);
+ }
+
+ /**
+ * Creates or updates an Update Instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param resource Update Instance details.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createAsync(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceInner resource) {
+ return beginCreateAsync(resourceGroupName, updateInstanceName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateInstanceInner create(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceInner resource) {
+ return create(resourceGroupName, updateInstanceName, resource, Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateInstanceInner create(String resourceGroupName, String updateInstanceName, UpdateInstanceInner resource,
+ Context context) {
+ return this.client
+ .getLroFinalResultOrError(beginCreate(resourceGroupName, updateInstanceName, resource, context));
+ }
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceUpdate properties) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, properties,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response updateWithResponse(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceUpdate properties) {
+ return updateWithResponse(resourceGroupName, updateInstanceName, properties, Context.NONE);
+ }
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response updateWithResponse(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceUpdate properties, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, properties,
+ context);
+ }
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of device Update instance details.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, UpdateInstanceInner> beginUpdateAsync(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceUpdate properties) {
+ Mono>> mono
+ = updateWithResponseAsync(resourceGroupName, updateInstanceName, properties);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ UpdateInstanceInner.class, UpdateInstanceInner.class, this.client.getContext());
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, UpdateInstanceInner> beginUpdate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceUpdate properties) {
+ return beginUpdate(resourceGroupName, updateInstanceName, properties, Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, UpdateInstanceInner> beginUpdate(String resourceGroupName,
+ String updateInstanceName, UpdateInstanceUpdate properties, Context context) {
+ Response response = updateWithResponse(resourceGroupName, updateInstanceName, properties, context);
+ return this.client.getLroResult(response, UpdateInstanceInner.class,
+ UpdateInstanceInner.class, context);
+ }
+
+ /**
+ * Updates update instance's patchable properties.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param properties Updated Update Instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return device Update instance details on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceUpdate properties) {
+ return beginUpdateAsync(resourceGroupName, updateInstanceName, properties).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateInstanceInner update(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceUpdate properties) {
+ return update(resourceGroupName, updateInstanceName, properties, Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public UpdateInstanceInner update(String resourceGroupName, String updateInstanceName,
+ UpdateInstanceUpdate properties, Context context) {
+ return this.client
+ .getLroFinalResultOrError(beginUpdate(resourceGroupName, updateInstanceName, properties, context));
+ }
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName,
+ String updateInstanceName) {
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response deleteWithResponse(String resourceGroupName, String updateInstanceName) {
+ return deleteWithResponse(resourceGroupName, updateInstanceName, Context.NONE);
+ }
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response deleteWithResponse(String resourceGroupName, String updateInstanceName,
+ Context context) {
+ return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, context);
+ }
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String updateInstanceName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, updateInstanceName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String updateInstanceName) {
+ return beginDelete(resourceGroupName, updateInstanceName, Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String updateInstanceName,
+ Context context) {
+ Response response = deleteWithResponse(resourceGroupName, updateInstanceName, context);
+ return this.client.getLroResult(response, Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes an update instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String updateInstanceName) {
+ return beginDeleteAsync(resourceGroupName, updateInstanceName).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String updateInstanceName) {
+ delete(resourceGroupName, updateInstanceName, Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String updateInstanceName, Context context) {
+ this.client.getLroFinalResultOrError(beginDelete(resourceGroupName, updateInstanceName, context));
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) {
+ return listByResourceGroupSinglePage(resourceGroupName, Context.NONE);
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupSinglePage(String resourceGroupName,
+ Context context) {
+ final String accept = "application/json";
+ Response res = service.listByResourceGroupSync(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return listByResourceGroup(resourceGroupName, Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePage(nextLink, context));
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage() {
+ return listSinglePage(Context.NONE);
+ }
+
+ /**
+ * Returns list of Update Instances.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(Context context) {
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return list(Context.NONE);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(() -> listSinglePage(context),
+ nextLink -> listBySubscriptionNextSinglePage(nextLink, context));
+ }
+
+ /**
+ * Check if the Update Instance name is available.
+ *
+ * @param body The CheckAvailability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest body) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), contentType, accept, body, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Check if the Update Instance name is available.
+ *
+ * @param body The CheckAvailability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono checkNameAvailabilityAsync(CheckNameAvailabilityRequest body) {
+ return checkNameAvailabilityWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response
+ checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), contentType, accept, body, context);
+ }
+
+ @Override
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CheckNameAvailabilityResultInner checkNameAvailability(CheckNameAvailabilityRequest body) {
+ return checkNameAvailabilityWithResponse(body, Context.NONE).getValue();
+ }
+
+ /**
+ * Preflight check for account linking readiness. No state change.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/preflight along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> linkPreflightWithResponseAsync(String resourceGroupName,
+ String updateInstanceName, LinkPreflightRequest body) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.linkPreflight(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Preflight check for account linking readiness. No state change.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/preflight on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono linkPreflightAsync(String resourceGroupName, String updateInstanceName,
+ LinkPreflightRequest body) {
+ return linkPreflightWithResponseAsync(resourceGroupName, updateInstanceName, body)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Preflight check for account linking readiness. No state change.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/preflight along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response linkPreflightWithResponse(String resourceGroupName, String updateInstanceName,
+ LinkPreflightRequest body, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.linkPreflightSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body, context);
+ }
+
+ /**
+ * Preflight check for account linking readiness. No state change.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/preflight.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ LinkPreflightResponse linkPreflight(String resourceGroupName, String updateInstanceName,
+ LinkPreflightRequest body) {
+ return linkPreflightWithResponse(resourceGroupName, updateInstanceName, body, Context.NONE).getValue();
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> linkInitiateWithResponseAsync(String resourceGroupName,
+ String updateInstanceName, LinkInitiateRequest body) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.linkInitiate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response linkInitiateWithResponse(String resourceGroupName, String updateInstanceName,
+ LinkInitiateRequest body) {
+ return linkInitiateWithResponse(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response linkInitiateWithResponse(String resourceGroupName, String updateInstanceName,
+ LinkInitiateRequest body, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.linkInitiateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body, context);
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of account linking information.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginLinkInitiateAsync(String resourceGroupName,
+ String updateInstanceName, LinkInitiateRequest body) {
+ Mono>> mono
+ = linkInitiateWithResponseAsync(resourceGroupName, updateInstanceName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of account linking information.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginLinkInitiate(String resourceGroupName, String updateInstanceName,
+ LinkInitiateRequest body) {
+ return beginLinkInitiate(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of account linking information.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginLinkInitiate(String resourceGroupName, String updateInstanceName,
+ LinkInitiateRequest body, Context context) {
+ Response response = linkInitiateWithResponse(resourceGroupName, updateInstanceName, body, context);
+ return this.client.getLroResult(response, Void.class, Void.class, context);
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono linkInitiateAsync(String resourceGroupName, String updateInstanceName,
+ LinkInitiateRequest body) {
+ return beginLinkInitiateAsync(resourceGroupName, updateInstanceName, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void linkInitiate(String resourceGroupName, String updateInstanceName, LinkInitiateRequest body) {
+ linkInitiate(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Initiate account linking. Validates and persists binding, sets linkingState=InProgress.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void linkInitiate(String resourceGroupName, String updateInstanceName, LinkInitiateRequest body, Context context) {
+ this.client.getLroFinalResultOrError(beginLinkInitiate(resourceGroupName, updateInstanceName, body, context));
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> linkNotifyWithResponseAsync(String resourceGroupName,
+ String updateInstanceName, LinkNotifyRequest body) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.linkNotify(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response linkNotifyWithResponse(String resourceGroupName, String updateInstanceName,
+ LinkNotifyRequest body) {
+ return linkNotifyWithResponse(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response linkNotifyWithResponse(String resourceGroupName, String updateInstanceName,
+ LinkNotifyRequest body, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.linkNotifySync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body, context);
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of account linking information.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginLinkNotifyAsync(String resourceGroupName, String updateInstanceName,
+ LinkNotifyRequest body) {
+ Mono>> mono
+ = linkNotifyWithResponseAsync(resourceGroupName, updateInstanceName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of account linking information.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginLinkNotify(String resourceGroupName, String updateInstanceName,
+ LinkNotifyRequest body) {
+ return beginLinkNotify(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of account linking information.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginLinkNotify(String resourceGroupName, String updateInstanceName,
+ LinkNotifyRequest body, Context context) {
+ Response response = linkNotifyWithResponse(resourceGroupName, updateInstanceName, body, context);
+ return this.client.getLroResult(response, Void.class, Void.class, context);
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return account linking information on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono linkNotifyAsync(String resourceGroupName, String updateInstanceName, LinkNotifyRequest body) {
+ return beginLinkNotifyAsync(resourceGroupName, updateInstanceName, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void linkNotify(String resourceGroupName, String updateInstanceName, LinkNotifyRequest body) {
+ linkNotify(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Notify linking state change (commit, fail, or namespaceDeleted).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void linkNotify(String resourceGroupName, String updateInstanceName, LinkNotifyRequest body, Context context) {
+ this.client.getLroFinalResultOrError(beginLinkNotify(resourceGroupName, updateInstanceName, body, context));
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/update along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> linkUpdateWithResponseAsync(String resourceGroupName,
+ String updateInstanceName, LinkUpdateRequest body) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.linkUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/update along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response linkUpdateWithResponse(String resourceGroupName, String updateInstanceName,
+ LinkUpdateRequest body) {
+ return linkUpdateWithResponse(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/update along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response linkUpdateWithResponse(String resourceGroupName, String updateInstanceName,
+ LinkUpdateRequest body, Context context) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.linkUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, updateInstanceName, contentType, accept, body, context);
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of response body for /link/update.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginLinkUpdateAsync(String resourceGroupName, String updateInstanceName,
+ LinkUpdateRequest body) {
+ Mono>> mono
+ = linkUpdateWithResponseAsync(resourceGroupName, updateInstanceName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response body for /link/update.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginLinkUpdate(String resourceGroupName, String updateInstanceName,
+ LinkUpdateRequest body) {
+ return beginLinkUpdate(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of response body for /link/update.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginLinkUpdate(String resourceGroupName, String updateInstanceName,
+ LinkUpdateRequest body, Context context) {
+ Response response = linkUpdateWithResponse(resourceGroupName, updateInstanceName, body, context);
+ return this.client.getLroResult(response, Void.class, Void.class, context);
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return response body for /link/update on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono linkUpdateAsync(String resourceGroupName, String updateInstanceName, LinkUpdateRequest body) {
+ return beginLinkUpdateAsync(resourceGroupName, updateInstanceName, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void linkUpdate(String resourceGroupName, String updateInstanceName, LinkUpdateRequest body) {
+ linkUpdate(resourceGroupName, updateInstanceName, body, Context.NONE);
+ }
+
+ /**
+ * Update linking properties (e.g., identity rotation).
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param updateInstanceName The user-chosen Update Instance name. Must be unique within the subscription and is
+ * used in the resource URL and ADU service routing. Allowed characters: alphanumeric and hyphens (not
+ * leading/trailing); length 3-36.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void linkUpdate(String resourceGroupName, String updateInstanceName, LinkUpdateRequest body, Context context) {
+ this.client.getLroFinalResultOrError(beginLinkUpdate(resourceGroupName, updateInstanceName, body, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupNextSinglePage(String nextLink) {
+ return listByResourceGroupNextSinglePage(nextLink, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) {
+ final String accept = "application/json";
+ Response res
+ = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listBySubscriptionNextSinglePage(String nextLink) {
+ return listBySubscriptionNextSinglePage(nextLink, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a UpdateInstance list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) {
+ final String accept = "application/json";
+ Response res
+ = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+}
diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancesImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancesImpl.java
new file mode 100644
index 0000000000000..8d2b8b03851b2
--- /dev/null
+++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry-softwareupdate/src/main/java/com/azure/resourcemanager/deviceregistry/softwareupdate/implementation/UpdateInstancesImpl.java
@@ -0,0 +1,132 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.deviceregistry.softwareupdate.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.UpdateInstancesClient;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.fluent.models.UpdateInstanceInner;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.CheckNameAvailabilityResult;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstance;
+import com.azure.resourcemanager.deviceregistry.softwareupdate.models.UpdateInstances;
+
+public final class UpdateInstancesImpl implements UpdateInstances {
+ private static final ClientLogger LOGGER = new ClientLogger(UpdateInstancesImpl.class);
+
+ private final UpdateInstancesClient innerClient;
+
+ private final com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager;
+
+ public UpdateInstancesImpl(UpdateInstancesClient innerClient,
+ com.azure.resourcemanager.deviceregistry.softwareupdate.DeviceRegistrySoftwareUpdateManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String updateInstanceName,
+ Context context) {
+ Response inner
+ = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, updateInstanceName, context);
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new UpdateInstanceImpl(inner.getValue(), this.manager()));
+ }
+
+ public UpdateInstance getByResourceGroup(String resourceGroupName, String updateInstanceName) {
+ UpdateInstanceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, updateInstanceName);
+ if (inner != null) {
+ return new UpdateInstanceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String updateInstanceName) {
+ this.delete(resourceGroupName, updateInstanceName, Context.NONE);
+ }
+
+ public void delete(String resourceGroupName, String updateInstanceName, Context context) {
+ this.serviceClient().delete(resourceGroupName, updateInstanceName, context);
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return this.listByResourceGroup(resourceGroupName, Context.NONE);
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new UpdateInstanceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list() {
+ return this.list(Context.NONE);
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable