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 scom service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the scom service API instance.
+ */
+ public ScomManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.scom")
+ .append("/")
+ .append("1.0.0-beta.1");
+ 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 ArmChallengeAuthenticationPolicy(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 ScomManager(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 Instances. It manages MonitoringInstance.
+ *
+ * @return Resource collection API of Instances.
+ */
+ public Instances instances() {
+ if (this.instances == null) {
+ this.instances = new InstancesImpl(clientObject.getInstances(), this);
+ }
+ return instances;
+ }
+
+ /**
+ * @return Wrapped service client AzureApiForManagingScomMonitoringInstances providing direct access to the
+ * underlying auto-generated API implementation, based on Azure REST API.
+ */
+ public AzureApiForManagingScomMonitoringInstances serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/AzureApiForManagingScomMonitoringInstances.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/AzureApiForManagingScomMonitoringInstances.java
new file mode 100644
index 000000000000..4dafc70507b1
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/AzureApiForManagingScomMonitoringInstances.java
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for AzureApiForManagingScomMonitoringInstances class. */
+public interface AzureApiForManagingScomMonitoringInstances {
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * 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 InstancesClient object to access its operations.
+ *
+ * @return the InstancesClient object.
+ */
+ InstancesClient getInstances();
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/InstancesClient.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/InstancesClient.java
new file mode 100644
index 000000000000..f3f5628566bc
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/InstancesClient.java
@@ -0,0 +1,388 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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.scom.fluent.models.MonitoringInstanceInner;
+import com.azure.resourcemanager.scom.models.MonitoringInstancePatch;
+import com.azure.resourcemanager.scom.models.ScalingProperties;
+
+/** An instance of this class provides access to all the operations defined in InstancesClient. */
+public interface InstancesClient {
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String instanceName, Context context);
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MonitoringInstanceInner getByResourceGroup(String resourceGroupName, String instanceName);
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MonitoringInstanceInner> beginCreateOrUpdate(
+ String resourceGroupName, String instanceName, MonitoringInstanceInner monitoringInstance);
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MonitoringInstanceInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode,
+ Context context);
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MonitoringInstanceInner createOrUpdate(
+ String resourceGroupName, String instanceName, MonitoringInstanceInner monitoringInstance);
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MonitoringInstanceInner createOrUpdate(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode,
+ Context context);
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MonitoringInstanceInner> beginUpdate(
+ String resourceGroupName, String instanceName);
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MonitoringInstanceInner> beginUpdate(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance, Context context);
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MonitoringInstanceInner update(String resourceGroupName, String instanceName);
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MonitoringInstanceInner update(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance, Context context);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String instanceName);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(String resourceGroupName, String instanceName, Context context);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String instanceName);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String instanceName, Context context);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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> beginScale(
+ String resourceGroupName, String instanceName, ScalingProperties body);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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> beginScale(
+ String resourceGroupName, String instanceName, ScalingProperties body, Context context);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 scale(String resourceGroupName, String instanceName, ScalingProperties body);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 scale(String resourceGroupName, String instanceName, ScalingProperties body, Context context);
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginPatchServers(String resourceGroupName, String instanceName);
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginPatchServers(
+ String resourceGroupName, String instanceName, Context context);
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void patchServers(String resourceGroupName, String instanceName);
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void patchServers(String resourceGroupName, String instanceName, Context context);
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/OperationsClient.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/OperationsClient.java
new file mode 100644
index 000000000000..547dfc987d0a
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/OperationsClient.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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.scom.fluent.models.OperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/MonitoringInstanceInner.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/MonitoringInstanceInner.java
new file mode 100644
index 000000000000..b83929041121
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/MonitoringInstanceInner.java
@@ -0,0 +1,116 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.scom.models.ManagedIdentity;
+import com.azure.resourcemanager.scom.models.MonitoringInstanceProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+
+/** A SCOM instance resource. */
+@Fluent
+public final class MonitoringInstanceInner extends Resource {
+ /*
+ * The properties of a SCOM instance resource
+ */
+ @JsonProperty(value = "properties")
+ private MonitoringInstanceProperties properties;
+
+ /*
+ * The system data.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /*
+ * The Azure Active Directory identity of the SCOM instance
+ */
+ @JsonProperty(value = "identity")
+ private ManagedIdentity identity;
+
+ /** Creates an instance of MonitoringInstanceInner class. */
+ public MonitoringInstanceInner() {
+ }
+
+ /**
+ * Get the properties property: The properties of a SCOM instance resource.
+ *
+ * @return the properties value.
+ */
+ public MonitoringInstanceProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The properties of a SCOM instance resource.
+ *
+ * @param properties the properties value to set.
+ * @return the MonitoringInstanceInner object itself.
+ */
+ public MonitoringInstanceInner withProperties(MonitoringInstanceProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: The system data.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the identity property: The Azure Active Directory identity of the SCOM instance.
+ *
+ * @return the identity value.
+ */
+ public ManagedIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The Azure Active Directory identity of the SCOM instance.
+ *
+ * @param identity the identity value to set.
+ * @return the MonitoringInstanceInner object itself.
+ */
+ public MonitoringInstanceInner withIdentity(ManagedIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public MonitoringInstanceInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public MonitoringInstanceInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ if (identity() != null) {
+ identity().validate();
+ }
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/OperationInner.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..2d52a61225e4
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/OperationInner.java
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.resourcemanager.scom.models.OperationDisplay;
+import com.azure.resourcemanager.scom.models.OperationOrigin;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** A REST API operation. */
+@Immutable
+public final class OperationInner {
+ /*
+ * Name of the operation being performed on this object
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private String name;
+
+ /*
+ * Contains the localized display information for this operation
+ */
+ @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY)
+ private OperationDisplay display;
+
+ /*
+ * The intended executor of the operation.
+ */
+ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
+ private OperationOrigin origin;
+
+ /** Creates an instance of OperationInner class. */
+ public OperationInner() {
+ }
+
+ /**
+ * Get the name property: Name of the operation being performed on this object.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the display property: Contains the localized display information for this operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation.
+ *
+ * @return the origin value.
+ */
+ public OperationOrigin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/package-info.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/models/package-info.java
new file mode 100644
index 000000000000..ee69a11bbb65
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/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) AutoRest Code Generator.
+
+/**
+ * Package containing the inner data models for AzureApiForManagingScomMonitoringInstances. SCOM monitoring instance
+ * management APIs.
+ */
+package com.azure.resourcemanager.scom.fluent.models;
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/package-info.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/fluent/package-info.java
new file mode 100644
index 000000000000..1997c9ef2736
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/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) AutoRest Code Generator.
+
+/**
+ * Package containing the service clients for AzureApiForManagingScomMonitoringInstances. SCOM monitoring instance
+ * management APIs.
+ */
+package com.azure.resourcemanager.scom.fluent;
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/AzureApiForManagingScomMonitoringInstancesBuilder.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/AzureApiForManagingScomMonitoringInstancesBuilder.java
new file mode 100644
index 000000000000..b7f53829ed57
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/AzureApiForManagingScomMonitoringInstancesBuilder.java
@@ -0,0 +1,144 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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 AzureApiForManagingScomMonitoringInstancesImpl type. */
+@ServiceClientBuilder(serviceClients = {AzureApiForManagingScomMonitoringInstancesImpl.class})
+public final class AzureApiForManagingScomMonitoringInstancesBuilder {
+ /*
+ * The ID of the target subscription.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the AzureApiForManagingScomMonitoringInstancesBuilder.
+ */
+ public AzureApiForManagingScomMonitoringInstancesBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the AzureApiForManagingScomMonitoringInstancesBuilder.
+ */
+ public AzureApiForManagingScomMonitoringInstancesBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the AzureApiForManagingScomMonitoringInstancesBuilder.
+ */
+ public AzureApiForManagingScomMonitoringInstancesBuilder 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 AzureApiForManagingScomMonitoringInstancesBuilder.
+ */
+ public AzureApiForManagingScomMonitoringInstancesBuilder 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 AzureApiForManagingScomMonitoringInstancesBuilder.
+ */
+ public AzureApiForManagingScomMonitoringInstancesBuilder 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 AzureApiForManagingScomMonitoringInstancesBuilder.
+ */
+ public AzureApiForManagingScomMonitoringInstancesBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of AzureApiForManagingScomMonitoringInstancesImpl with the provided parameters.
+ *
+ * @return an instance of AzureApiForManagingScomMonitoringInstancesImpl.
+ */
+ public AzureApiForManagingScomMonitoringInstancesImpl 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();
+ AzureApiForManagingScomMonitoringInstancesImpl client =
+ new AzureApiForManagingScomMonitoringInstancesImpl(
+ localPipeline,
+ localSerializerAdapter,
+ localDefaultPollInterval,
+ localEnvironment,
+ subscriptionId,
+ localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/AzureApiForManagingScomMonitoringInstancesImpl.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/AzureApiForManagingScomMonitoringInstancesImpl.java
new file mode 100644
index 000000000000..e29d7c6be1a9
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/AzureApiForManagingScomMonitoringInstancesImpl.java
@@ -0,0 +1,305 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+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.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.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.scom.fluent.AzureApiForManagingScomMonitoringInstances;
+import com.azure.resourcemanager.scom.fluent.InstancesClient;
+import com.azure.resourcemanager.scom.fluent.OperationsClient;
+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 AzureApiForManagingScomMonitoringInstancesImpl type. */
+@ServiceClient(builder = AzureApiForManagingScomMonitoringInstancesBuilder.class)
+public final class AzureApiForManagingScomMonitoringInstancesImpl
+ implements AzureApiForManagingScomMonitoringInstances {
+ /** The ID of the target subscription. */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** 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 InstancesClient object to access its operations. */
+ private final InstancesClient instances;
+
+ /**
+ * Gets the InstancesClient object to access its operations.
+ *
+ * @return the InstancesClient object.
+ */
+ public InstancesClient getInstances() {
+ return this.instances;
+ }
+
+ /**
+ * Initializes an instance of AzureApiForManagingScomMonitoringInstances 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 subscriptionId The ID of the target subscription.
+ * @param endpoint server parameter.
+ */
+ AzureApiForManagingScomMonitoringInstancesImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2022-09-13-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.instances = new InstancesClientImpl(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 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) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse =
+ new HttpResponseImpl(
+ lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().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(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ 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 ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(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(AzureApiForManagingScomMonitoringInstancesImpl.class);
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/InstancesClientImpl.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/InstancesClientImpl.java
new file mode 100644
index 000000000000..1c2aefd2333e
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/InstancesClientImpl.java
@@ -0,0 +1,2196 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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.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.scom.fluent.InstancesClient;
+import com.azure.resourcemanager.scom.fluent.models.MonitoringInstanceInner;
+import com.azure.resourcemanager.scom.models.MonitoringInstanceList;
+import com.azure.resourcemanager.scom.models.MonitoringInstancePatch;
+import com.azure.resourcemanager.scom.models.ScalingProperties;
+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 InstancesClient. */
+public final class InstancesClientImpl implements InstancesClient {
+ /** The proxy service used to perform REST calls. */
+ private final InstancesService service;
+
+ /** The service client containing this operation class. */
+ private final AzureApiForManagingScomMonitoringInstancesImpl client;
+
+ /**
+ * Initializes an instance of InstancesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ InstancesClientImpl(AzureApiForManagingScomMonitoringInstancesImpl client) {
+ this.service =
+ RestProxy.create(InstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureApiForManagingScomMonitoringInstancesInstances to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureApiForManagingS")
+ public interface InstancesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/managedInstances")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Scom/managedInstances")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/managedInstances/{instanceName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("instanceName") String instanceName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/managedInstances/{instanceName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("instanceName") String instanceName,
+ @QueryParam("api-version") String apiVersion,
+ @QueryParam("validationMode") Boolean validationMode,
+ @BodyParam("application/json") MonitoringInstanceInner monitoringInstance,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/managedInstances/{instanceName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("instanceName") String instanceName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") MonitoringInstancePatch monitoringInstance,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/managedInstances/{instanceName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("instanceName") String instanceName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/managedInstances/{instanceName}/setServerCount")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> scale(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("instanceName") String instanceName,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") ScalingProperties body,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/managedInstances/{instanceName}/patchServers")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> patchServers(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("instanceName") String instanceName,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") 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("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ 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()));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ 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()));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String instanceName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String instanceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String instanceName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, instanceName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String instanceName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, instanceName, context).block();
+ }
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MonitoringInstanceInner getByResourceGroup(String resourceGroupName, String instanceName) {
+ return getByResourceGroupWithResponse(resourceGroupName, instanceName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ if (monitoringInstance == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter monitoringInstance is required and cannot be null."));
+ } else {
+ monitoringInstance.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ validationMode,
+ monitoringInstance,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ if (monitoringInstance == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter monitoringInstance is required and cannot be null."));
+ } else {
+ monitoringInstance.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ validationMode,
+ monitoringInstance,
+ accept,
+ context);
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MonitoringInstanceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, instanceName, monitoringInstance, validationMode);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ MonitoringInstanceInner.class,
+ MonitoringInstanceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MonitoringInstanceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String instanceName, MonitoringInstanceInner monitoringInstance) {
+ final Boolean validationMode = null;
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, instanceName, monitoringInstance, validationMode);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ MonitoringInstanceInner.class,
+ MonitoringInstanceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 the {@link PollerFlux} for polling of a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MonitoringInstanceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(
+ resourceGroupName, instanceName, monitoringInstance, validationMode, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ MonitoringInstanceInner.class,
+ MonitoringInstanceInner.class,
+ context);
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring 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 SyncPoller} for polling of a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MonitoringInstanceInner> beginCreateOrUpdate(
+ String resourceGroupName, String instanceName, MonitoringInstanceInner monitoringInstance) {
+ final Boolean validationMode = null;
+ return this
+ .beginCreateOrUpdateAsync(resourceGroupName, instanceName, monitoringInstance, validationMode)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 the {@link SyncPoller} for polling of a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MonitoringInstanceInner> beginCreateOrUpdate(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode,
+ Context context) {
+ return this
+ .beginCreateOrUpdateAsync(resourceGroupName, instanceName, monitoringInstance, validationMode, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode) {
+ return beginCreateOrUpdateAsync(resourceGroupName, instanceName, monitoringInstance, validationMode)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring 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 a SCOM instance resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String instanceName, MonitoringInstanceInner monitoringInstance) {
+ final Boolean validationMode = null;
+ return beginCreateOrUpdateAsync(resourceGroupName, instanceName, monitoringInstance, validationMode)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode,
+ Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, instanceName, monitoringInstance, validationMode, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MonitoringInstanceInner createOrUpdate(
+ String resourceGroupName, String instanceName, MonitoringInstanceInner monitoringInstance) {
+ final Boolean validationMode = null;
+ return createOrUpdateAsync(resourceGroupName, instanceName, monitoringInstance, validationMode).block();
+ }
+
+ /**
+ * Create or update SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM Monitoring Instance.
+ * @param validationMode Validation mode for the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MonitoringInstanceInner createOrUpdate(
+ String resourceGroupName,
+ String instanceName,
+ MonitoringInstanceInner monitoringInstance,
+ Boolean validationMode,
+ Context context) {
+ return createOrUpdateAsync(resourceGroupName, instanceName, monitoringInstance, validationMode, context)
+ .block();
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 SCOM instance resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ if (monitoringInstance != null) {
+ monitoringInstance.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ monitoringInstance,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 SCOM instance resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ if (monitoringInstance != null) {
+ monitoringInstance.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ monitoringInstance,
+ accept,
+ context);
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MonitoringInstanceInner> beginUpdateAsync(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance) {
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, instanceName, monitoringInstance);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ MonitoringInstanceInner.class,
+ MonitoringInstanceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MonitoringInstanceInner> beginUpdateAsync(
+ String resourceGroupName, String instanceName) {
+ final MonitoringInstancePatch monitoringInstance = null;
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, instanceName, monitoringInstance);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ MonitoringInstanceInner.class,
+ MonitoringInstanceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 PollerFlux} for polling of a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MonitoringInstanceInner> beginUpdateAsync(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ updateWithResponseAsync(resourceGroupName, instanceName, monitoringInstance, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ MonitoringInstanceInner.class,
+ MonitoringInstanceInner.class,
+ context);
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 SyncPoller} for polling of a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MonitoringInstanceInner> beginUpdate(
+ String resourceGroupName, String instanceName) {
+ final MonitoringInstancePatch monitoringInstance = null;
+ return this.beginUpdateAsync(resourceGroupName, instanceName, monitoringInstance).getSyncPoller();
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MonitoringInstanceInner> beginUpdate(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, instanceName, monitoringInstance, context).getSyncPoller();
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 SCOM instance resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance) {
+ return beginUpdateAsync(resourceGroupName, instanceName, monitoringInstance)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 a SCOM instance resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String instanceName) {
+ final MonitoringInstancePatch monitoringInstance = null;
+ return beginUpdateAsync(resourceGroupName, instanceName, monitoringInstance)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 SCOM instance resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance, Context context) {
+ return beginUpdateAsync(resourceGroupName, instanceName, monitoringInstance, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 a SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MonitoringInstanceInner update(String resourceGroupName, String instanceName) {
+ final MonitoringInstancePatch monitoringInstance = null;
+ return updateAsync(resourceGroupName, instanceName, monitoringInstance).block();
+ }
+
+ /**
+ * Patch SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param monitoringInstance SCOM monitoring instance properties update.
+ * @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 SCOM instance resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MonitoringInstanceInner update(
+ String resourceGroupName, String instanceName, MonitoringInstancePatch monitoringInstance, Context context) {
+ return updateAsync(resourceGroupName, instanceName, monitoringInstance, context).block();
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName, String instanceName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String instanceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String instanceName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, instanceName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(
+ String resourceGroupName, String instanceName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, instanceName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(String resourceGroupName, String instanceName) {
+ return this.beginDeleteAsync(resourceGroupName, instanceName).getSyncPoller();
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginDelete(
+ String resourceGroupName, String instanceName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, instanceName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String instanceName) {
+ return beginDeleteAsync(resourceGroupName, instanceName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String instanceName, Context context) {
+ return beginDeleteAsync(resourceGroupName, instanceName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String instanceName) {
+ deleteAsync(resourceGroupName, instanceName).block();
+ }
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String resourceGroupName, String instanceName, Context context) {
+ deleteAsync(resourceGroupName, instanceName, context).block();
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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>> scaleWithResponseAsync(
+ String resourceGroupName, String instanceName, ScalingProperties body) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .scale(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ body,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> scaleWithResponseAsync(
+ String resourceGroupName, String instanceName, ScalingProperties body, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .scale(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ body,
+ accept,
+ context);
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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> beginScaleAsync(
+ String resourceGroupName, String instanceName, ScalingProperties body) {
+ Mono>> mono = scaleWithResponseAsync(resourceGroupName, instanceName, body);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginScaleAsync(
+ String resourceGroupName, String instanceName, ScalingProperties body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = scaleWithResponseAsync(resourceGroupName, instanceName, body, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginScale(
+ String resourceGroupName, String instanceName, ScalingProperties body) {
+ return this.beginScaleAsync(resourceGroupName, instanceName, body).getSyncPoller();
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginScale(
+ String resourceGroupName, String instanceName, ScalingProperties body, Context context) {
+ return this.beginScaleAsync(resourceGroupName, instanceName, body, context).getSyncPoller();
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 scaleAsync(String resourceGroupName, String instanceName, ScalingProperties body) {
+ return beginScaleAsync(resourceGroupName, instanceName, body)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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 {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono scaleAsync(
+ String resourceGroupName, String instanceName, ScalingProperties body, Context context) {
+ return beginScaleAsync(resourceGroupName, instanceName, body, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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)
+ public void scale(String resourceGroupName, String instanceName, ScalingProperties body) {
+ scaleAsync(resourceGroupName, instanceName, body).block();
+ }
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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)
+ public void scale(String resourceGroupName, String instanceName, ScalingProperties body, Context context) {
+ scaleAsync(resourceGroupName, instanceName, body, context).block();
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> patchServersWithResponseAsync(
+ String resourceGroupName, String instanceName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .patchServers(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> patchServersWithResponseAsync(
+ String resourceGroupName, String instanceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (instanceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter instanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .patchServers(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ instanceName,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginPatchServersAsync(String resourceGroupName, String instanceName) {
+ Mono>> mono = patchServersWithResponseAsync(resourceGroupName, instanceName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginPatchServersAsync(
+ String resourceGroupName, String instanceName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = patchServersWithResponseAsync(resourceGroupName, instanceName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginPatchServers(String resourceGroupName, String instanceName) {
+ return this.beginPatchServersAsync(resourceGroupName, instanceName).getSyncPoller();
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginPatchServers(
+ String resourceGroupName, String instanceName, Context context) {
+ return this.beginPatchServersAsync(resourceGroupName, instanceName, context).getSyncPoller();
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono patchServersAsync(String resourceGroupName, String instanceName) {
+ return beginPatchServersAsync(resourceGroupName, instanceName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono patchServersAsync(String resourceGroupName, String instanceName, Context context) {
+ return beginPatchServersAsync(resourceGroupName, instanceName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void patchServers(String resourceGroupName, String instanceName) {
+ patchServersAsync(resourceGroupName, instanceName).block();
+ }
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void patchServers(String resourceGroupName, String instanceName, Context context) {
+ patchServersAsync(resourceGroupName, instanceName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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 paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ 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
+ * The nextLink parameter.
+ * @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 paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return 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));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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 paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ 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
+ * The nextLink parameter.
+ * @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 paged list of SCOM monitoring instances along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return 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));
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/InstancesImpl.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/InstancesImpl.java
new file mode 100644
index 000000000000..58c217d2ac21
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/InstancesImpl.java
@@ -0,0 +1,194 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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.scom.fluent.InstancesClient;
+import com.azure.resourcemanager.scom.fluent.models.MonitoringInstanceInner;
+import com.azure.resourcemanager.scom.models.Instances;
+import com.azure.resourcemanager.scom.models.MonitoringInstance;
+import com.azure.resourcemanager.scom.models.ScalingProperties;
+
+public final class InstancesImpl implements Instances {
+ private static final ClientLogger LOGGER = new ClientLogger(InstancesImpl.class);
+
+ private final InstancesClient innerClient;
+
+ private final com.azure.resourcemanager.scom.ScomManager serviceManager;
+
+ public InstancesImpl(InstancesClient innerClient, com.azure.resourcemanager.scom.ScomManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new MonitoringInstanceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new MonitoringInstanceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new MonitoringInstanceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new MonitoringInstanceImpl(inner1, this.manager()));
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String instanceName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, instanceName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new MonitoringInstanceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public MonitoringInstance getByResourceGroup(String resourceGroupName, String instanceName) {
+ MonitoringInstanceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, instanceName);
+ if (inner != null) {
+ return new MonitoringInstanceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String instanceName) {
+ this.serviceClient().delete(resourceGroupName, instanceName);
+ }
+
+ public void delete(String resourceGroupName, String instanceName, Context context) {
+ this.serviceClient().delete(resourceGroupName, instanceName, context);
+ }
+
+ public void scale(String resourceGroupName, String instanceName, ScalingProperties body) {
+ this.serviceClient().scale(resourceGroupName, instanceName, body);
+ }
+
+ public void scale(String resourceGroupName, String instanceName, ScalingProperties body, Context context) {
+ this.serviceClient().scale(resourceGroupName, instanceName, body, context);
+ }
+
+ public void patchServers(String resourceGroupName, String instanceName) {
+ this.serviceClient().patchServers(resourceGroupName, instanceName);
+ }
+
+ public void patchServers(String resourceGroupName, String instanceName, Context context) {
+ this.serviceClient().patchServers(resourceGroupName, instanceName, context);
+ }
+
+ public MonitoringInstance getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String instanceName = Utils.getValueFromIdByName(id, "managedInstances");
+ if (instanceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, instanceName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String instanceName = Utils.getValueFromIdByName(id, "managedInstances");
+ if (instanceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, instanceName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String instanceName = Utils.getValueFromIdByName(id, "managedInstances");
+ if (instanceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id)));
+ }
+ this.delete(resourceGroupName, instanceName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String instanceName = Utils.getValueFromIdByName(id, "managedInstances");
+ if (instanceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'managedInstances'.", id)));
+ }
+ this.delete(resourceGroupName, instanceName, context);
+ }
+
+ private InstancesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.scom.ScomManager manager() {
+ return this.serviceManager;
+ }
+
+ public MonitoringInstanceImpl define(String name) {
+ return new MonitoringInstanceImpl(name, this.manager());
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/MonitoringInstanceImpl.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/MonitoringInstanceImpl.java
new file mode 100644
index 000000000000..260a06fb539c
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/MonitoringInstanceImpl.java
@@ -0,0 +1,225 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.scom.fluent.models.MonitoringInstanceInner;
+import com.azure.resourcemanager.scom.models.ManagedIdentity;
+import com.azure.resourcemanager.scom.models.MonitoringInstance;
+import com.azure.resourcemanager.scom.models.MonitoringInstancePatch;
+import com.azure.resourcemanager.scom.models.MonitoringInstanceProperties;
+import com.azure.resourcemanager.scom.models.ScalingProperties;
+import java.util.Collections;
+import java.util.Map;
+
+public final class MonitoringInstanceImpl
+ implements MonitoringInstance, MonitoringInstance.Definition, MonitoringInstance.Update {
+ private MonitoringInstanceInner innerObject;
+
+ private final com.azure.resourcemanager.scom.ScomManager 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 MonitoringInstanceProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ManagedIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public MonitoringInstanceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.scom.ScomManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String instanceName;
+
+ private Boolean createValidationMode;
+
+ private MonitoringInstancePatch updateMonitoringInstance;
+
+ public MonitoringInstanceImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public MonitoringInstance create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getInstances()
+ .createOrUpdate(resourceGroupName, instanceName, this.innerModel(), createValidationMode, Context.NONE);
+ return this;
+ }
+
+ public MonitoringInstance create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getInstances()
+ .createOrUpdate(resourceGroupName, instanceName, this.innerModel(), createValidationMode, context);
+ return this;
+ }
+
+ MonitoringInstanceImpl(String name, com.azure.resourcemanager.scom.ScomManager serviceManager) {
+ this.innerObject = new MonitoringInstanceInner();
+ this.serviceManager = serviceManager;
+ this.instanceName = name;
+ this.createValidationMode = null;
+ }
+
+ public MonitoringInstanceImpl update() {
+ this.updateMonitoringInstance = new MonitoringInstancePatch();
+ return this;
+ }
+
+ public MonitoringInstance apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getInstances()
+ .update(resourceGroupName, instanceName, updateMonitoringInstance, Context.NONE);
+ return this;
+ }
+
+ public MonitoringInstance apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getInstances()
+ .update(resourceGroupName, instanceName, updateMonitoringInstance, context);
+ return this;
+ }
+
+ MonitoringInstanceImpl(
+ MonitoringInstanceInner innerObject, com.azure.resourcemanager.scom.ScomManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.instanceName = Utils.getValueFromIdByName(innerObject.id(), "managedInstances");
+ }
+
+ public MonitoringInstance refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getInstances()
+ .getByResourceGroupWithResponse(resourceGroupName, instanceName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public MonitoringInstance refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getInstances()
+ .getByResourceGroupWithResponse(resourceGroupName, instanceName, context)
+ .getValue();
+ return this;
+ }
+
+ public void scale(ScalingProperties body) {
+ serviceManager.instances().scale(resourceGroupName, instanceName, body);
+ }
+
+ public void scale(ScalingProperties body, Context context) {
+ serviceManager.instances().scale(resourceGroupName, instanceName, body, context);
+ }
+
+ public void patchServers() {
+ serviceManager.instances().patchServers(resourceGroupName, instanceName);
+ }
+
+ public void patchServers(Context context) {
+ serviceManager.instances().patchServers(resourceGroupName, instanceName, context);
+ }
+
+ public MonitoringInstanceImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public MonitoringInstanceImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public MonitoringInstanceImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateMonitoringInstance.withTags(tags);
+ return this;
+ }
+ }
+
+ public MonitoringInstanceImpl withProperties(MonitoringInstanceProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+
+ public MonitoringInstanceImpl withIdentity(ManagedIdentity identity) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ }
+
+ public MonitoringInstanceImpl withValidationMode(Boolean validationMode) {
+ this.createValidationMode = validationMode;
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationImpl.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationImpl.java
new file mode 100644
index 000000000000..952015ea5129
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationImpl.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.implementation;
+
+import com.azure.resourcemanager.scom.fluent.models.OperationInner;
+import com.azure.resourcemanager.scom.models.Operation;
+import com.azure.resourcemanager.scom.models.OperationDisplay;
+import com.azure.resourcemanager.scom.models.OperationOrigin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.scom.ScomManager serviceManager;
+
+ OperationImpl(OperationInner innerObject, com.azure.resourcemanager.scom.ScomManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public OperationOrigin origin() {
+ return this.innerModel().origin();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.scom.ScomManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationsClientImpl.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..a635bc81ae9f
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationsClientImpl.java
@@ -0,0 +1,316 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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.scom.fluent.OperationsClient;
+import com.azure.resourcemanager.scom.fluent.models.OperationInner;
+import com.azure.resourcemanager.scom.models.OperationsList;
+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 AzureApiForManagingScomMonitoringInstancesImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(AzureApiForManagingScomMonitoringInstancesImpl client) {
+ this.service =
+ RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureApiForManagingScomMonitoringInstancesOperations to be used by
+ * the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureApiForManagingS")
+ public interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scom/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @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("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ 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()));
+ }
+
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Lists all available operations on SCOM monitoring instance.
+ *
+ * @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 list of operations as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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 list of operations along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ 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
+ * The nextLink parameter.
+ * @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 list of operations along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return 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));
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationsImpl.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..92e8d4dcef22
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/OperationsImpl.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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.scom.fluent.OperationsClient;
+import com.azure.resourcemanager.scom.fluent.models.OperationInner;
+import com.azure.resourcemanager.scom.models.Operation;
+import com.azure.resourcemanager.scom.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.scom.ScomManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.scom.ScomManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.scom.ScomManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/Utils.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/Utils.java
new file mode 100644
index 000000000000..a793e5d9023f
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/Utils.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.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.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class Utils {
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (segments.size() > 0 && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ 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, PagedResponse>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ 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/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/package-info.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/package-info.java
new file mode 100644
index 000000000000..9f1eb9771f7f
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/implementation/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the implementations for AzureApiForManagingScomMonitoringInstances. SCOM monitoring instance
+ * management APIs.
+ */
+package com.azure.resourcemanager.scom.implementation;
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/AzureHybridBenefitProperties.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/AzureHybridBenefitProperties.java
new file mode 100644
index 000000000000..c56f5d0d593d
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/AzureHybridBenefitProperties.java
@@ -0,0 +1,111 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties to maximize savings by using Azure Hybrid Benefit. */
+@Fluent
+public final class AzureHybridBenefitProperties {
+ /*
+ * SCOM license type. Maximize savings by using license you already own
+ */
+ @JsonProperty(value = "scomLicenseType")
+ private HybridLicenseType scomLicenseType;
+
+ /*
+ * Specifies that the image or disk that is being used was licensed on-premises.
For more information, see
+ * [Azure Hybrid Use Benefit for Windows
+ * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
+ */
+ @JsonProperty(value = "windowsServerLicenseType")
+ private HybridLicenseType windowsServerLicenseType;
+
+ /*
+ * SQL Server license type. Maximize savings by using Azure Hybrid Benefit for SQL Server with license you already
+ * own
+ */
+ @JsonProperty(value = "sqlServerLicenseType")
+ private HybridLicenseType sqlServerLicenseType;
+
+ /** Creates an instance of AzureHybridBenefitProperties class. */
+ public AzureHybridBenefitProperties() {
+ }
+
+ /**
+ * Get the scomLicenseType property: SCOM license type. Maximize savings by using license you already own.
+ *
+ * @return the scomLicenseType value.
+ */
+ public HybridLicenseType scomLicenseType() {
+ return this.scomLicenseType;
+ }
+
+ /**
+ * Set the scomLicenseType property: SCOM license type. Maximize savings by using license you already own.
+ *
+ * @param scomLicenseType the scomLicenseType value to set.
+ * @return the AzureHybridBenefitProperties object itself.
+ */
+ public AzureHybridBenefitProperties withScomLicenseType(HybridLicenseType scomLicenseType) {
+ this.scomLicenseType = scomLicenseType;
+ return this;
+ }
+
+ /**
+ * Get the windowsServerLicenseType property: Specifies that the image or disk that is being used was licensed
+ * on-premises. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows
+ * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ *
+ * @return the windowsServerLicenseType value.
+ */
+ public HybridLicenseType windowsServerLicenseType() {
+ return this.windowsServerLicenseType;
+ }
+
+ /**
+ * Set the windowsServerLicenseType property: Specifies that the image or disk that is being used was licensed
+ * on-premises. <br><br> For more information, see [Azure Hybrid Use Benefit for Windows
+ * Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ *
+ * @param windowsServerLicenseType the windowsServerLicenseType value to set.
+ * @return the AzureHybridBenefitProperties object itself.
+ */
+ public AzureHybridBenefitProperties withWindowsServerLicenseType(HybridLicenseType windowsServerLicenseType) {
+ this.windowsServerLicenseType = windowsServerLicenseType;
+ return this;
+ }
+
+ /**
+ * Get the sqlServerLicenseType property: SQL Server license type. Maximize savings by using Azure Hybrid Benefit
+ * for SQL Server with license you already own.
+ *
+ * @return the sqlServerLicenseType value.
+ */
+ public HybridLicenseType sqlServerLicenseType() {
+ return this.sqlServerLicenseType;
+ }
+
+ /**
+ * Set the sqlServerLicenseType property: SQL Server license type. Maximize savings by using Azure Hybrid Benefit
+ * for SQL Server with license you already own.
+ *
+ * @param sqlServerLicenseType the sqlServerLicenseType value to set.
+ * @return the AzureHybridBenefitProperties object itself.
+ */
+ public AzureHybridBenefitProperties withSqlServerLicenseType(HybridLicenseType sqlServerLicenseType) {
+ this.sqlServerLicenseType = sqlServerLicenseType;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DatabaseInstanceProperties.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DatabaseInstanceProperties.java
new file mode 100644
index 000000000000..a486c5d51048
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DatabaseInstanceProperties.java
@@ -0,0 +1,110 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties of database instance. */
+@Fluent
+public final class DatabaseInstanceProperties {
+ /*
+ * Resource Id of existing database instance
+ */
+ @JsonProperty(value = "databaseInstanceId")
+ private String databaseInstanceId;
+
+ /*
+ * Fully qualified domain name of existing database instance
+ */
+ @JsonProperty(value = "databaseFqdn", access = JsonProperty.Access.WRITE_ONLY)
+ private String databaseFqdn;
+
+ /*
+ * Name of warehouse database on database instance
+ */
+ @JsonProperty(value = "dwDatabaseName", access = JsonProperty.Access.WRITE_ONLY)
+ private String dwDatabaseName;
+
+ /*
+ * Resource Id of operational database on database instance
+ */
+ @JsonProperty(value = "operationalDatabaseId", access = JsonProperty.Access.WRITE_ONLY)
+ private String operationalDatabaseId;
+
+ /*
+ * Resource Id of warehouse database on database instance
+ */
+ @JsonProperty(value = "dwDatabaseId", access = JsonProperty.Access.WRITE_ONLY)
+ private String dwDatabaseId;
+
+ /** Creates an instance of DatabaseInstanceProperties class. */
+ public DatabaseInstanceProperties() {
+ }
+
+ /**
+ * Get the databaseInstanceId property: Resource Id of existing database instance.
+ *
+ * @return the databaseInstanceId value.
+ */
+ public String databaseInstanceId() {
+ return this.databaseInstanceId;
+ }
+
+ /**
+ * Set the databaseInstanceId property: Resource Id of existing database instance.
+ *
+ * @param databaseInstanceId the databaseInstanceId value to set.
+ * @return the DatabaseInstanceProperties object itself.
+ */
+ public DatabaseInstanceProperties withDatabaseInstanceId(String databaseInstanceId) {
+ this.databaseInstanceId = databaseInstanceId;
+ return this;
+ }
+
+ /**
+ * Get the databaseFqdn property: Fully qualified domain name of existing database instance.
+ *
+ * @return the databaseFqdn value.
+ */
+ public String databaseFqdn() {
+ return this.databaseFqdn;
+ }
+
+ /**
+ * Get the dwDatabaseName property: Name of warehouse database on database instance.
+ *
+ * @return the dwDatabaseName value.
+ */
+ public String dwDatabaseName() {
+ return this.dwDatabaseName;
+ }
+
+ /**
+ * Get the operationalDatabaseId property: Resource Id of operational database on database instance.
+ *
+ * @return the operationalDatabaseId value.
+ */
+ public String operationalDatabaseId() {
+ return this.operationalDatabaseId;
+ }
+
+ /**
+ * Get the dwDatabaseId property: Resource Id of warehouse database on database instance.
+ *
+ * @return the dwDatabaseId value.
+ */
+ public String dwDatabaseId() {
+ return this.dwDatabaseId;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DomainControllerProperties.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DomainControllerProperties.java
new file mode 100644
index 000000000000..6ea01ee13819
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DomainControllerProperties.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties of domain controller to which SCOM and SQL servers join for AuthN/AuthZ. */
+@Fluent
+public final class DomainControllerProperties {
+ /*
+ * Fully qualified domain name
+ */
+ @JsonProperty(value = "domainName")
+ private String domainName;
+
+ /*
+ * IP address of DNS server
+ */
+ @JsonProperty(value = "dnsServer")
+ private String dnsServer;
+
+ /*
+ * Organizational Unit path in which the SCOM servers will be present
+ */
+ @JsonProperty(value = "ouPath")
+ private String ouPath;
+
+ /** Creates an instance of DomainControllerProperties class. */
+ public DomainControllerProperties() {
+ }
+
+ /**
+ * Get the domainName property: Fully qualified domain name.
+ *
+ * @return the domainName value.
+ */
+ public String domainName() {
+ return this.domainName;
+ }
+
+ /**
+ * Set the domainName property: Fully qualified domain name.
+ *
+ * @param domainName the domainName value to set.
+ * @return the DomainControllerProperties object itself.
+ */
+ public DomainControllerProperties withDomainName(String domainName) {
+ this.domainName = domainName;
+ return this;
+ }
+
+ /**
+ * Get the dnsServer property: IP address of DNS server.
+ *
+ * @return the dnsServer value.
+ */
+ public String dnsServer() {
+ return this.dnsServer;
+ }
+
+ /**
+ * Set the dnsServer property: IP address of DNS server.
+ *
+ * @param dnsServer the dnsServer value to set.
+ * @return the DomainControllerProperties object itself.
+ */
+ public DomainControllerProperties withDnsServer(String dnsServer) {
+ this.dnsServer = dnsServer;
+ return this;
+ }
+
+ /**
+ * Get the ouPath property: Organizational Unit path in which the SCOM servers will be present.
+ *
+ * @return the ouPath value.
+ */
+ public String ouPath() {
+ return this.ouPath;
+ }
+
+ /**
+ * Set the ouPath property: Organizational Unit path in which the SCOM servers will be present.
+ *
+ * @param ouPath the ouPath value to set.
+ * @return the DomainControllerProperties object itself.
+ */
+ public DomainControllerProperties withOuPath(String ouPath) {
+ this.ouPath = ouPath;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DomainUserCredentials.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DomainUserCredentials.java
new file mode 100644
index 000000000000..b60ac6b15d7b
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/DomainUserCredentials.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Get Domain user name and password from key vault. */
+@Fluent
+public final class DomainUserCredentials {
+ /*
+ * Key vault url to get the domain username and password
+ */
+ @JsonProperty(value = "keyVaultUrl")
+ private String keyVaultUrl;
+
+ /*
+ * Domain user name secret
+ */
+ @JsonProperty(value = "userNameSecret")
+ private String usernameSecret;
+
+ /*
+ * Domain Password secret
+ */
+ @JsonProperty(value = "passwordSecret")
+ private String passwordSecret;
+
+ /** Creates an instance of DomainUserCredentials class. */
+ public DomainUserCredentials() {
+ }
+
+ /**
+ * Get the keyVaultUrl property: Key vault url to get the domain username and password.
+ *
+ * @return the keyVaultUrl value.
+ */
+ public String keyVaultUrl() {
+ return this.keyVaultUrl;
+ }
+
+ /**
+ * Set the keyVaultUrl property: Key vault url to get the domain username and password.
+ *
+ * @param keyVaultUrl the keyVaultUrl value to set.
+ * @return the DomainUserCredentials object itself.
+ */
+ public DomainUserCredentials withKeyVaultUrl(String keyVaultUrl) {
+ this.keyVaultUrl = keyVaultUrl;
+ return this;
+ }
+
+ /**
+ * Get the usernameSecret property: Domain user name secret.
+ *
+ * @return the usernameSecret value.
+ */
+ public String usernameSecret() {
+ return this.usernameSecret;
+ }
+
+ /**
+ * Set the usernameSecret property: Domain user name secret.
+ *
+ * @param usernameSecret the usernameSecret value to set.
+ * @return the DomainUserCredentials object itself.
+ */
+ public DomainUserCredentials withUsernameSecret(String usernameSecret) {
+ this.usernameSecret = usernameSecret;
+ return this;
+ }
+
+ /**
+ * Get the passwordSecret property: Domain Password secret.
+ *
+ * @return the passwordSecret value.
+ */
+ public String passwordSecret() {
+ return this.passwordSecret;
+ }
+
+ /**
+ * Set the passwordSecret property: Domain Password secret.
+ *
+ * @param passwordSecret the passwordSecret value to set.
+ * @return the DomainUserCredentials object itself.
+ */
+ public DomainUserCredentials withPasswordSecret(String passwordSecret) {
+ this.passwordSecret = passwordSecret;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/GmsaDetails.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/GmsaDetails.java
new file mode 100644
index 000000000000..fe100ac71d8f
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/GmsaDetails.java
@@ -0,0 +1,134 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Gmsa Details. */
+@Fluent
+public final class GmsaDetails {
+ /*
+ * Frontend IP configuration for Load Balancer, which should be an available IP in customer VNet
+ */
+ @JsonProperty(value = "loadBalancerIP")
+ private String loadBalancerIp;
+
+ /*
+ * gMSA account under which context all Management Server services will run
+ */
+ @JsonProperty(value = "gmsaAccount")
+ private String gmsaAccount;
+
+ /*
+ * OnPrem AD Computer Group where we will join VMs for ease of management
+ */
+ @JsonProperty(value = "managementServerGroupName")
+ private String managementServerGroupName;
+
+ /*
+ * Frontend DNS name for Load Balancer which will be used by Agents to initiate communication
+ */
+ @JsonProperty(value = "dnsName")
+ private String dnsName;
+
+ /** Creates an instance of GmsaDetails class. */
+ public GmsaDetails() {
+ }
+
+ /**
+ * Get the loadBalancerIp property: Frontend IP configuration for Load Balancer, which should be an available IP in
+ * customer VNet.
+ *
+ * @return the loadBalancerIp value.
+ */
+ public String loadBalancerIp() {
+ return this.loadBalancerIp;
+ }
+
+ /**
+ * Set the loadBalancerIp property: Frontend IP configuration for Load Balancer, which should be an available IP in
+ * customer VNet.
+ *
+ * @param loadBalancerIp the loadBalancerIp value to set.
+ * @return the GmsaDetails object itself.
+ */
+ public GmsaDetails withLoadBalancerIp(String loadBalancerIp) {
+ this.loadBalancerIp = loadBalancerIp;
+ return this;
+ }
+
+ /**
+ * Get the gmsaAccount property: gMSA account under which context all Management Server services will run.
+ *
+ * @return the gmsaAccount value.
+ */
+ public String gmsaAccount() {
+ return this.gmsaAccount;
+ }
+
+ /**
+ * Set the gmsaAccount property: gMSA account under which context all Management Server services will run.
+ *
+ * @param gmsaAccount the gmsaAccount value to set.
+ * @return the GmsaDetails object itself.
+ */
+ public GmsaDetails withGmsaAccount(String gmsaAccount) {
+ this.gmsaAccount = gmsaAccount;
+ return this;
+ }
+
+ /**
+ * Get the managementServerGroupName property: OnPrem AD Computer Group where we will join VMs for ease of
+ * management.
+ *
+ * @return the managementServerGroupName value.
+ */
+ public String managementServerGroupName() {
+ return this.managementServerGroupName;
+ }
+
+ /**
+ * Set the managementServerGroupName property: OnPrem AD Computer Group where we will join VMs for ease of
+ * management.
+ *
+ * @param managementServerGroupName the managementServerGroupName value to set.
+ * @return the GmsaDetails object itself.
+ */
+ public GmsaDetails withManagementServerGroupName(String managementServerGroupName) {
+ this.managementServerGroupName = managementServerGroupName;
+ return this;
+ }
+
+ /**
+ * Get the dnsName property: Frontend DNS name for Load Balancer which will be used by Agents to initiate
+ * communication.
+ *
+ * @return the dnsName value.
+ */
+ public String dnsName() {
+ return this.dnsName;
+ }
+
+ /**
+ * Set the dnsName property: Frontend DNS name for Load Balancer which will be used by Agents to initiate
+ * communication.
+ *
+ * @param dnsName the dnsName value to set.
+ * @return the GmsaDetails object itself.
+ */
+ public GmsaDetails withDnsName(String dnsName) {
+ this.dnsName = dnsName;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/HybridLicenseType.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/HybridLicenseType.java
new file mode 100644
index 000000000000..5db81757f214
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/HybridLicenseType.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.Collection;
+
+/** License type for various SCOM infra components. */
+public final class HybridLicenseType extends ExpandableStringEnum {
+ /** Static value None for HybridLicenseType. */
+ public static final HybridLicenseType NONE = fromString("None");
+
+ /** Static value AzureHybridBenefit for HybridLicenseType. */
+ public static final HybridLicenseType AZURE_HYBRID_BENEFIT = fromString("AzureHybridBenefit");
+
+ /**
+ * Creates a new instance of HybridLicenseType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public HybridLicenseType() {
+ }
+
+ /**
+ * Creates or finds a HybridLicenseType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding HybridLicenseType.
+ */
+ @JsonCreator
+ public static HybridLicenseType fromString(String name) {
+ return fromString(name, HybridLicenseType.class);
+ }
+
+ /**
+ * Gets known HybridLicenseType values.
+ *
+ * @return known HybridLicenseType values.
+ */
+ public static Collection values() {
+ return values(HybridLicenseType.class);
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/Instances.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/Instances.java
new file mode 100644
index 000000000000..4be554d72ac1
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/Instances.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+
+/** Resource collection API of Instances. */
+public interface Instances {
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Lists all SCOM monitoring instances in a resource group.
+ *
+ * @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 a paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list();
+
+ /**
+ * Lists all SCOM monitoring instances in a subscription.
+ *
+ * @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 paged list of SCOM monitoring instances as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list(Context context);
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details along with {@link Response}.
+ */
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String instanceName, Context context);
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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 sCOM monitoring instance details.
+ */
+ MonitoringInstance getByResourceGroup(String resourceGroupName, String instanceName);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ void deleteByResourceGroup(String resourceGroupName, String instanceName);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ void delete(String resourceGroupName, String instanceName, Context context);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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.
+ */
+ void scale(String resourceGroupName, String instanceName, ScalingProperties body);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring instance.
+ * @param body Properties for Scaling.
+ * @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.
+ */
+ void scale(String resourceGroupName, String instanceName, ScalingProperties body, Context context);
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ void patchServers(String resourceGroupName, String instanceName);
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param instanceName Name of the SCOM monitoring 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.
+ */
+ void patchServers(String resourceGroupName, String instanceName, Context context);
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param id the resource ID.
+ * @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 sCOM monitoring instance details along with {@link Response}.
+ */
+ MonitoringInstance getById(String id);
+
+ /**
+ * Get SCOM monitoring instance details.
+ *
+ * @param id the resource ID.
+ * @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 sCOM monitoring instance details along with {@link Response}.
+ */
+ Response getByIdWithResponse(String id, Context context);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param id the resource ID.
+ * @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.
+ */
+ void deleteById(String id);
+
+ /**
+ * Delete a SCOM monitoring instance.
+ *
+ * @param id the resource ID.
+ * @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.
+ */
+ void deleteByIdWithResponse(String id, Context context);
+
+ /**
+ * Begins definition for a new MonitoringInstance resource.
+ *
+ * @param name resource name.
+ * @return the first stage of the new MonitoringInstance definition.
+ */
+ MonitoringInstance.DefinitionStages.Blank define(String name);
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedIdentity.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedIdentity.java
new file mode 100644
index 000000000000..550075a672d7
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedIdentity.java
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Map;
+import java.util.UUID;
+
+/** Azure Active Directory identity configuration for a resource. */
+@Fluent
+public final class ManagedIdentity {
+ /*
+ * The identity type
+ */
+ @JsonProperty(value = "type")
+ private ManagedIdentityType type;
+
+ /*
+ * System Assigned Identity ObjectId.
+ */
+ @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY)
+ private UUID principalId;
+
+ /*
+ * The Azure Active Directory tenant id.
+ */
+ @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY)
+ private String tenantId;
+
+ /*
+ * The resource ids of the user assigned identities to use
+ */
+ @JsonProperty(value = "userAssignedIdentities")
+ @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
+ private Map userAssignedIdentities;
+
+ /** Creates an instance of ManagedIdentity class. */
+ public ManagedIdentity() {
+ }
+
+ /**
+ * Get the type property: The identity type.
+ *
+ * @return the type value.
+ */
+ public ManagedIdentityType type() {
+ return this.type;
+ }
+
+ /**
+ * Set the type property: The identity type.
+ *
+ * @param type the type value to set.
+ * @return the ManagedIdentity object itself.
+ */
+ public ManagedIdentity withType(ManagedIdentityType type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * Get the principalId property: System Assigned Identity ObjectId.
+ *
+ * @return the principalId value.
+ */
+ public UUID principalId() {
+ return this.principalId;
+ }
+
+ /**
+ * Get the tenantId property: The Azure Active Directory tenant id.
+ *
+ * @return the tenantId value.
+ */
+ public String tenantId() {
+ return this.tenantId;
+ }
+
+ /**
+ * Get the userAssignedIdentities property: The resource ids of the user assigned identities to use.
+ *
+ * @return the userAssignedIdentities value.
+ */
+ public Map userAssignedIdentities() {
+ return this.userAssignedIdentities;
+ }
+
+ /**
+ * Set the userAssignedIdentities property: The resource ids of the user assigned identities to use.
+ *
+ * @param userAssignedIdentities the userAssignedIdentities value to set.
+ * @return the ManagedIdentity object itself.
+ */
+ public ManagedIdentity withUserAssignedIdentities(Map userAssignedIdentities) {
+ this.userAssignedIdentities = userAssignedIdentities;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (userAssignedIdentities() != null) {
+ userAssignedIdentities()
+ .values()
+ .forEach(
+ e -> {
+ if (e != null) {
+ e.validate();
+ }
+ });
+ }
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedIdentityType.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedIdentityType.java
new file mode 100644
index 000000000000..45e43368f0e1
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedIdentityType.java
@@ -0,0 +1,53 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.util.Collection;
+
+/** The identity type. */
+public final class ManagedIdentityType extends ExpandableStringEnum {
+ /** Static value None for ManagedIdentityType. */
+ public static final ManagedIdentityType NONE = fromString("None");
+
+ /** Static value UserAssigned for ManagedIdentityType. */
+ public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned");
+
+ /** Static value SystemAssigned for ManagedIdentityType. */
+ public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned");
+
+ /** Static value SystemAssigned,UserAssigned for ManagedIdentityType. */
+ public static final ManagedIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned");
+
+ /**
+ * Creates a new instance of ManagedIdentityType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ManagedIdentityType() {
+ }
+
+ /**
+ * Creates or finds a ManagedIdentityType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ManagedIdentityType.
+ */
+ @JsonCreator
+ public static ManagedIdentityType fromString(String name) {
+ return fromString(name, ManagedIdentityType.class);
+ }
+
+ /**
+ * Gets known ManagedIdentityType values.
+ *
+ * @return known ManagedIdentityType values.
+ */
+ public static Collection values() {
+ return values(ManagedIdentityType.class);
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedInstanceOperationStatus.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedInstanceOperationStatus.java
new file mode 100644
index 000000000000..6d74344f92a6
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagedInstanceOperationStatus.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Gets status of current and latest SCOM managed instance Operation. */
+@Immutable
+public final class ManagedInstanceOperationStatus {
+ /*
+ * Operation Name
+ */
+ @JsonProperty(value = "operationName", access = JsonProperty.Access.WRITE_ONLY)
+ private String operationName;
+
+ /*
+ * Operation status
+ */
+ @JsonProperty(value = "operationState", access = JsonProperty.Access.WRITE_ONLY)
+ private String operationState;
+
+ /** Creates an instance of ManagedInstanceOperationStatus class. */
+ public ManagedInstanceOperationStatus() {
+ }
+
+ /**
+ * Get the operationName property: Operation Name.
+ *
+ * @return the operationName value.
+ */
+ public String operationName() {
+ return this.operationName;
+ }
+
+ /**
+ * Get the operationState property: Operation status.
+ *
+ * @return the operationState value.
+ */
+ public String operationState() {
+ return this.operationState;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagementServerProperties.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagementServerProperties.java
new file mode 100644
index 000000000000..aad07d74d7ae
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/ManagementServerProperties.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Immutable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The properties of management server. */
+@Immutable
+public final class ManagementServerProperties {
+ /*
+ * Management server Name
+ */
+ @JsonProperty(value = "serverName", access = JsonProperty.Access.WRITE_ONLY)
+ private String serverName;
+
+ /*
+ * Azure VM Resource Id of the Management server
+ */
+ @JsonProperty(value = "vmResId", access = JsonProperty.Access.WRITE_ONLY)
+ private String vmResId;
+
+ /*
+ * Management server Fully Qualified Domain Name
+ */
+ @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY)
+ private String fqdn;
+
+ /*
+ * Represent whether the Server is a Management Server and/or Web Console Server
+ */
+ @JsonProperty(value = "serverRoles", access = JsonProperty.Access.WRITE_ONLY)
+ private String serverRoles;
+
+ /*
+ * Management server health state
+ */
+ @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY)
+ private String healthState;
+
+ /** Creates an instance of ManagementServerProperties class. */
+ public ManagementServerProperties() {
+ }
+
+ /**
+ * Get the serverName property: Management server Name.
+ *
+ * @return the serverName value.
+ */
+ public String serverName() {
+ return this.serverName;
+ }
+
+ /**
+ * Get the vmResId property: Azure VM Resource Id of the Management server.
+ *
+ * @return the vmResId value.
+ */
+ public String vmResId() {
+ return this.vmResId;
+ }
+
+ /**
+ * Get the fqdn property: Management server Fully Qualified Domain Name.
+ *
+ * @return the fqdn value.
+ */
+ public String fqdn() {
+ return this.fqdn;
+ }
+
+ /**
+ * Get the serverRoles property: Represent whether the Server is a Management Server and/or Web Console Server.
+ *
+ * @return the serverRoles value.
+ */
+ public String serverRoles() {
+ return this.serverRoles;
+ }
+
+ /**
+ * Get the healthState property: Management server health state.
+ *
+ * @return the healthState value.
+ */
+ public String healthState() {
+ return this.healthState;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/MonitoringInstance.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/MonitoringInstance.java
new file mode 100644
index 000000000000..32fdac81a611
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/MonitoringInstance.java
@@ -0,0 +1,305 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.scom.fluent.models.MonitoringInstanceInner;
+import java.util.Map;
+
+/** An immutable client-side representation of MonitoringInstance. */
+public interface MonitoringInstance {
+ /**
+ * Gets the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * Gets the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * Gets the location property: The geo-location where the resource lives.
+ *
+ * @return the location value.
+ */
+ String location();
+
+ /**
+ * Gets the tags property: Resource tags.
+ *
+ * @return the tags value.
+ */
+ Map tags();
+
+ /**
+ * Gets the properties property: The properties of a SCOM instance resource.
+ *
+ * @return the properties value.
+ */
+ MonitoringInstanceProperties properties();
+
+ /**
+ * Gets the systemData property: The system data.
+ *
+ * @return the systemData value.
+ */
+ SystemData systemData();
+
+ /**
+ * Gets the identity property: The Azure Active Directory identity of the SCOM instance.
+ *
+ * @return the identity value.
+ */
+ ManagedIdentity identity();
+
+ /**
+ * Gets the region of the resource.
+ *
+ * @return the region of the resource.
+ */
+ Region region();
+
+ /**
+ * Gets the name of the resource region.
+ *
+ * @return the name of the resource region.
+ */
+ String regionName();
+
+ /**
+ * Gets the name of the resource group.
+ *
+ * @return the name of the resource group.
+ */
+ String resourceGroupName();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.scom.fluent.models.MonitoringInstanceInner object.
+ *
+ * @return the inner object.
+ */
+ MonitoringInstanceInner innerModel();
+
+ /** The entirety of the MonitoringInstance definition. */
+ interface Definition
+ extends DefinitionStages.Blank,
+ DefinitionStages.WithLocation,
+ DefinitionStages.WithResourceGroup,
+ DefinitionStages.WithCreate {
+ }
+
+ /** The MonitoringInstance definition stages. */
+ interface DefinitionStages {
+ /** The first stage of the MonitoringInstance definition. */
+ interface Blank extends WithLocation {
+ }
+
+ /** The stage of the MonitoringInstance definition allowing to specify location. */
+ interface WithLocation {
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(Region location);
+
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(String location);
+ }
+
+ /** The stage of the MonitoringInstance definition allowing to specify parent resource. */
+ interface WithResourceGroup {
+ /**
+ * Specifies resourceGroupName.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @return the next definition stage.
+ */
+ WithCreate withExistingResourceGroup(String resourceGroupName);
+ }
+
+ /**
+ * The stage of the MonitoringInstance definition which contains all the minimum required properties for the
+ * resource to be created, but also allows for any other optional properties to be specified.
+ */
+ interface WithCreate
+ extends DefinitionStages.WithTags,
+ DefinitionStages.WithProperties,
+ DefinitionStages.WithIdentity,
+ DefinitionStages.WithValidationMode {
+ /**
+ * Executes the create request.
+ *
+ * @return the created resource.
+ */
+ MonitoringInstance create();
+
+ /**
+ * Executes the create request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the created resource.
+ */
+ MonitoringInstance create(Context context);
+ }
+
+ /** The stage of the MonitoringInstance definition allowing to specify tags. */
+ interface WithTags {
+ /**
+ * Specifies the tags property: Resource tags..
+ *
+ * @param tags Resource tags.
+ * @return the next definition stage.
+ */
+ WithCreate withTags(Map tags);
+ }
+
+ /** The stage of the MonitoringInstance definition allowing to specify properties. */
+ interface WithProperties {
+ /**
+ * Specifies the properties property: The properties of a SCOM instance resource.
+ *
+ * @param properties The properties of a SCOM instance resource.
+ * @return the next definition stage.
+ */
+ WithCreate withProperties(MonitoringInstanceProperties properties);
+ }
+
+ /** The stage of the MonitoringInstance definition allowing to specify identity. */
+ interface WithIdentity {
+ /**
+ * Specifies the identity property: The Azure Active Directory identity of the SCOM instance.
+ *
+ * @param identity The Azure Active Directory identity of the SCOM instance.
+ * @return the next definition stage.
+ */
+ WithCreate withIdentity(ManagedIdentity identity);
+ }
+
+ /** The stage of the MonitoringInstance definition allowing to specify validationMode. */
+ interface WithValidationMode {
+ /**
+ * Specifies the validationMode property: Validation mode for the SCOM monitoring instance.
+ *
+ * @param validationMode Validation mode for the SCOM monitoring instance.
+ * @return the next definition stage.
+ */
+ WithCreate withValidationMode(Boolean validationMode);
+ }
+ }
+
+ /**
+ * Begins update for the MonitoringInstance resource.
+ *
+ * @return the stage of resource update.
+ */
+ MonitoringInstance.Update update();
+
+ /** The template for MonitoringInstance update. */
+ interface Update extends UpdateStages.WithTags {
+ /**
+ * Executes the update request.
+ *
+ * @return the updated resource.
+ */
+ MonitoringInstance apply();
+
+ /**
+ * Executes the update request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the updated resource.
+ */
+ MonitoringInstance apply(Context context);
+ }
+
+ /** The MonitoringInstance update stages. */
+ interface UpdateStages {
+ /** The stage of the MonitoringInstance update allowing to specify tags. */
+ interface WithTags {
+ /**
+ * Specifies the tags property: Resource tags..
+ *
+ * @param tags Resource tags.
+ * @return the next definition stage.
+ */
+ Update withTags(Map tags);
+ }
+ }
+
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @return the refreshed resource.
+ */
+ MonitoringInstance refresh();
+
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @param context The context to associate with this operation.
+ * @return the refreshed resource.
+ */
+ MonitoringInstance refresh(Context context);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param body Properties for Scaling.
+ * @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.
+ */
+ void scale(ScalingProperties body);
+
+ /**
+ * Scaling SCOM monitoring instance.
+ *
+ * @param body Properties for Scaling.
+ * @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.
+ */
+ void scale(ScalingProperties body, Context context);
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @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.
+ */
+ void patchServers();
+
+ /**
+ * Update SCOM servers with latest scom software.
+ *
+ * @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.
+ */
+ void patchServers(Context context);
+}
diff --git a/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/MonitoringInstanceList.java b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/MonitoringInstanceList.java
new file mode 100644
index 000000000000..4b59a78614e8
--- /dev/null
+++ b/sdk/scom/azure-resourcemanager-scom/src/main/java/com/azure/resourcemanager/scom/models/MonitoringInstanceList.java
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.scom.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.resourcemanager.scom.fluent.models.MonitoringInstanceInner;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** A paged list of SCOM monitoring instances. */
+@Immutable
+public final class MonitoringInstanceList {
+ /*
+ * The items on the page
+ */
+ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
+ private List