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 Mongo Cluster service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Mongo Cluster service API instance.
+ */
+ public MongoClusterManager 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.mongocluster")
+ .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 MongoClusterManager(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 MongoClusters. It manages MongoCluster.
+ *
+ * @return Resource collection API of MongoClusters.
+ */
+ public MongoClusters mongoClusters() {
+ if (this.mongoClusters == null) {
+ this.mongoClusters = new MongoClustersImpl(clientObject.getMongoClusters(), this);
+ }
+ return mongoClusters;
+ }
+
+ /**
+ * Gets the resource collection API of FirewallRules. It manages FirewallRule.
+ *
+ * @return Resource collection API of FirewallRules.
+ */
+ public FirewallRules firewallRules() {
+ if (this.firewallRules == null) {
+ this.firewallRules = new FirewallRulesImpl(clientObject.getFirewallRules(), this);
+ }
+ return firewallRules;
+ }
+
+ /**
+ * Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnectionResource.
+ *
+ * @return Resource collection API of PrivateEndpointConnections.
+ */
+ public PrivateEndpointConnections privateEndpointConnections() {
+ if (this.privateEndpointConnections == null) {
+ this.privateEndpointConnections
+ = new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this);
+ }
+ return privateEndpointConnections;
+ }
+
+ /**
+ * Gets the resource collection API of PrivateLinks.
+ *
+ * @return Resource collection API of PrivateLinks.
+ */
+ public PrivateLinks privateLinks() {
+ if (this.privateLinks == null) {
+ this.privateLinks = new PrivateLinksImpl(clientObject.getPrivateLinks(), this);
+ }
+ return privateLinks;
+ }
+
+ /**
+ * Gets the resource collection API of Replicas.
+ *
+ * @return Resource collection API of Replicas.
+ */
+ public Replicas replicas() {
+ if (this.replicas == null) {
+ this.replicas = new ReplicasImpl(clientObject.getReplicas(), this);
+ }
+ return replicas;
+ }
+
+ /**
+ * Gets wrapped service client DocumentDBClient providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client DocumentDBClient.
+ */
+ public DocumentDBClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java
new file mode 100644
index 0000000000000..5220b7f9d9783
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/DocumentDBClient.java
@@ -0,0 +1,90 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for DocumentDBClient class.
+ */
+public interface DocumentDBClient {
+ /**
+ * Gets Server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the MongoClustersClient object to access its operations.
+ *
+ * @return the MongoClustersClient object.
+ */
+ MongoClustersClient getMongoClusters();
+
+ /**
+ * Gets the FirewallRulesClient object to access its operations.
+ *
+ * @return the FirewallRulesClient object.
+ */
+ FirewallRulesClient getFirewallRules();
+
+ /**
+ * Gets the PrivateEndpointConnectionsClient object to access its operations.
+ *
+ * @return the PrivateEndpointConnectionsClient object.
+ */
+ PrivateEndpointConnectionsClient getPrivateEndpointConnections();
+
+ /**
+ * Gets the PrivateLinksClient object to access its operations.
+ *
+ * @return the PrivateLinksClient object.
+ */
+ PrivateLinksClient getPrivateLinks();
+
+ /**
+ * Gets the ReplicasClient object to access its operations.
+ *
+ * @return the ReplicasClient object.
+ */
+ ReplicasClient getReplicas();
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/FirewallRulesClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/FirewallRulesClient.java
new file mode 100644
index 0000000000000..a5f4aca0ed63f
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/FirewallRulesClient.java
@@ -0,0 +1,201 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.models.FirewallRuleInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in FirewallRulesClient.
+ */
+public interface FirewallRulesClient {
+ /**
+ * Gets information about a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 information about a mongo cluster firewall rule along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName, Context context);
+
+ /**
+ * Gets information about a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 information about a mongo cluster firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FirewallRuleInner get(String resourceGroupName, String mongoClusterName, String firewallRuleName);
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @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, FirewallRuleInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, String firewallRuleName, FirewallRuleInner resource);
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @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, FirewallRuleInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, String firewallRuleName, FirewallRuleInner resource, Context context);
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FirewallRuleInner createOrUpdate(String resourceGroupName, String mongoClusterName, String firewallRuleName,
+ FirewallRuleInner resource);
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FirewallRuleInner createOrUpdate(String resourceGroupName, String mongoClusterName, String firewallRuleName,
+ FirewallRuleInner resource, Context context);
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName);
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName, Context context);
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName, String firewallRuleName);
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName, String firewallRuleName, Context context);
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName);
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
+ Context context);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClustersClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClustersClient.java
new file mode 100644
index 0000000000000..9e9d2dd1c2640
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/MongoClustersClient.java
@@ -0,0 +1,397 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.mongocluster.fluent.models.ListConnectionStringsResultInner;
+import com.azure.resourcemanager.mongocluster.fluent.models.MongoClusterInner;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
+
+/**
+ * An instance of this class provides access to all the operations defined in MongoClustersClient.
+ */
+public interface MongoClustersClient {
+ /**
+ * Gets information about a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 information about a mongo cluster along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String mongoClusterName,
+ Context context);
+
+ /**
+ * Gets information about a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 information about a mongo cluster.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MongoClusterInner getByResourceGroup(String resourceGroupName, String mongoClusterName);
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MongoClusterInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterInner resource);
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MongoClusterInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterInner resource, Context context);
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MongoClusterInner createOrUpdate(String resourceGroupName, String mongoClusterName, MongoClusterInner resource);
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MongoClusterInner createOrUpdate(String resourceGroupName, String mongoClusterName, MongoClusterInner resource,
+ Context context);
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MongoClusterInner> beginUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterUpdate properties);
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, MongoClusterInner> beginUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterUpdate properties, Context context);
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MongoClusterInner update(String resourceGroupName, String mongoClusterName, MongoClusterUpdate properties);
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MongoClusterInner update(String resourceGroupName, String mongoClusterName, MongoClusterUpdate properties,
+ Context context);
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName);
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName, Context context);
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName);
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName, Context context);
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well
+ * as other connection strings supported by the cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 connection strings for the given mongo cluster along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listConnectionStringsWithResponse(String resourceGroupName,
+ String mongoClusterName, Context context);
+
+ /**
+ * List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well
+ * as other connection strings supported by the cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 connection strings for the given mongo cluster.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ListConnectionStringsResultInner listConnectionStrings(String resourceGroupName, String mongoClusterName);
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The location name.
+ * @param body The CheckAvailability request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response checkNameAvailabilityWithResponse(String location,
+ CheckNameAvailabilityRequest body, Context context);
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The location name.
+ * @param body The CheckAvailability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CheckNameAvailabilityResponseInner checkNameAvailability(String location, CheckNameAvailabilityRequest body);
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body);
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body, Context context);
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body);
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body, Context context);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/OperationsClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/OperationsClient.java
new file mode 100644
index 0000000000000..fc74d29eef1cb
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/OperationsClient.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.models.OperationInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public interface OperationsClient {
+ /**
+ * List the operations for the provider.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/PrivateEndpointConnectionsClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/PrivateEndpointConnectionsClient.java
new file mode 100644
index 0000000000000..afaa0178d1a10
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/PrivateEndpointConnectionsClient.java
@@ -0,0 +1,218 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.models.PrivateEndpointConnectionResourceInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient.
+ */
+public interface PrivateEndpointConnectionsClient {
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName,
+ String mongoClusterName);
+
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName,
+ String mongoClusterName, Context context);
+
+ /**
+ * Get a specific private connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 specific private connection along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String resourceGroupName, String mongoClusterName,
+ String privateEndpointConnectionName, Context context);
+
+ /**
+ * Get a specific private connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 specific private connection.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionResourceInner get(String resourceGroupName, String mongoClusterName,
+ String privateEndpointConnectionName);
+
+ /**
+ * Create a Private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @param resource Resource create parameters.
+ * @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, PrivateEndpointConnectionResourceInner> beginCreate(
+ String resourceGroupName, String mongoClusterName, String privateEndpointConnectionName,
+ PrivateEndpointConnectionResourceInner resource);
+
+ /**
+ * Create a Private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @param resource Resource create parameters.
+ * @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, PrivateEndpointConnectionResourceInner> beginCreate(
+ String resourceGroupName, String mongoClusterName, String privateEndpointConnectionName,
+ PrivateEndpointConnectionResourceInner resource, Context context);
+
+ /**
+ * Create a Private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionResourceInner create(String resourceGroupName, String mongoClusterName,
+ String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource);
+
+ /**
+ * Create a Private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ PrivateEndpointConnectionResourceInner create(String resourceGroupName, String mongoClusterName,
+ String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner resource, Context context);
+
+ /**
+ * Delete the private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 mongoClusterName,
+ String privateEndpointConnectionName);
+
+ /**
+ * Delete the private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 mongoClusterName,
+ String privateEndpointConnectionName, Context context);
+
+ /**
+ * Delete the private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 mongoClusterName, String privateEndpointConnectionName);
+
+ /**
+ * Delete the private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 mongoClusterName, String privateEndpointConnectionName,
+ Context context);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/PrivateLinksClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/PrivateLinksClient.java
new file mode 100644
index 0000000000000..8779553179b88
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/PrivateLinksClient.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.models.PrivateLinkResourceInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in PrivateLinksClient.
+ */
+public interface PrivateLinksClient {
+ /**
+ * list private links on the given resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName);
+
+ /**
+ * list private links on the given resource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateLinkResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
+ Context context);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/ReplicasClient.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/ReplicasClient.java
new file mode 100644
index 0000000000000..043dd56bfb2c1
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/ReplicasClient.java
@@ -0,0 +1,43 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.models.ReplicaInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in ReplicasClient.
+ */
+public interface ReplicasClient {
+ /**
+ * List all the replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName);
+
+ /**
+ * List all the replicas for the mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Replica list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName, Context context);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/CheckNameAvailabilityResponseInner.java
new file mode 100644
index 0000000000000..4e3682130046d
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/CheckNameAvailabilityResponseInner.java
@@ -0,0 +1,120 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityReason;
+import java.io.IOException;
+
+/**
+ * The check availability result.
+ */
+@Immutable
+public final class CheckNameAvailabilityResponseInner implements JsonSerializable {
+ /*
+ * Indicates if the resource name is available.
+ */
+ private Boolean nameAvailable;
+
+ /*
+ * The reason why the given name is not available.
+ */
+ private CheckNameAvailabilityReason reason;
+
+ /*
+ * Detailed reason why the given name is not available.
+ */
+ private String message;
+
+ /**
+ * Creates an instance of CheckNameAvailabilityResponseInner class.
+ */
+ private CheckNameAvailabilityResponseInner() {
+ }
+
+ /**
+ * Get the nameAvailable property: Indicates if the resource name is available.
+ *
+ * @return the nameAvailable value.
+ */
+ public Boolean nameAvailable() {
+ return this.nameAvailable;
+ }
+
+ /**
+ * Get the reason property: The reason why the given name is not available.
+ *
+ * @return the reason value.
+ */
+ public CheckNameAvailabilityReason reason() {
+ return this.reason;
+ }
+
+ /**
+ * Get the message property: Detailed reason why the given name is not available.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable);
+ jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString());
+ jsonWriter.writeStringField("message", this.message);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of CheckNameAvailabilityResponseInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of CheckNameAvailabilityResponseInner if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the CheckNameAvailabilityResponseInner.
+ */
+ public static CheckNameAvailabilityResponseInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ CheckNameAvailabilityResponseInner deserializedCheckNameAvailabilityResponseInner
+ = new CheckNameAvailabilityResponseInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("nameAvailable".equals(fieldName)) {
+ deserializedCheckNameAvailabilityResponseInner.nameAvailable
+ = reader.getNullable(JsonReader::getBoolean);
+ } else if ("reason".equals(fieldName)) {
+ deserializedCheckNameAvailabilityResponseInner.reason
+ = CheckNameAvailabilityReason.fromString(reader.getString());
+ } else if ("message".equals(fieldName)) {
+ deserializedCheckNameAvailabilityResponseInner.message = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedCheckNameAvailabilityResponseInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/FirewallRuleInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/FirewallRuleInner.java
new file mode 100644
index 0000000000000..18de0706ef34a
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/FirewallRuleInner.java
@@ -0,0 +1,166 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.FirewallRuleProperties;
+import java.io.IOException;
+
+/**
+ * Represents a mongo cluster firewall rule.
+ */
+@Fluent
+public final class FirewallRuleInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private FirewallRuleProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /**
+ * Creates an instance of FirewallRuleInner class.
+ */
+ public FirewallRuleInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public FirewallRuleProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the FirewallRuleInner object itself.
+ */
+ public FirewallRuleInner withProperties(FirewallRuleProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of FirewallRuleInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of FirewallRuleInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the FirewallRuleInner.
+ */
+ public static FirewallRuleInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ FirewallRuleInner deserializedFirewallRuleInner = new FirewallRuleInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedFirewallRuleInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedFirewallRuleInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedFirewallRuleInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedFirewallRuleInner.properties = FirewallRuleProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedFirewallRuleInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedFirewallRuleInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ListConnectionStringsResultInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ListConnectionStringsResultInner.java
new file mode 100644
index 0000000000000..7070e9205a959
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ListConnectionStringsResultInner.java
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.ConnectionString;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The connection strings for the given mongo cluster.
+ */
+@Immutable
+public final class ListConnectionStringsResultInner implements JsonSerializable {
+ /*
+ * An array that contains the connection strings for a mongo cluster.
+ */
+ private List connectionStrings;
+
+ /**
+ * Creates an instance of ListConnectionStringsResultInner class.
+ */
+ private ListConnectionStringsResultInner() {
+ }
+
+ /**
+ * Get the connectionStrings property: An array that contains the connection strings for a mongo cluster.
+ *
+ * @return the connectionStrings value.
+ */
+ public List connectionStrings() {
+ return this.connectionStrings;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (connectionStrings() != null) {
+ connectionStrings().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ListConnectionStringsResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ListConnectionStringsResultInner if the JsonReader was pointing to an instance of it, or
+ * null if it was pointing to JSON null.
+ * @throws IOException If an error occurs while reading the ListConnectionStringsResultInner.
+ */
+ public static ListConnectionStringsResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ListConnectionStringsResultInner deserializedListConnectionStringsResultInner
+ = new ListConnectionStringsResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("connectionStrings".equals(fieldName)) {
+ List connectionStrings
+ = reader.readArray(reader1 -> ConnectionString.fromJson(reader1));
+ deserializedListConnectionStringsResultInner.connectionStrings = connectionStrings;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedListConnectionStringsResultInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterInner.java
new file mode 100644
index 0000000000000..5720c3558a3de
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/MongoClusterInner.java
@@ -0,0 +1,192 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Represents a mongo cluster resource.
+ */
+@Fluent
+public final class MongoClusterInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private MongoClusterProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /**
+ * Creates an instance of MongoClusterInner class.
+ */
+ public MongoClusterInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public MongoClusterProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the MongoClusterInner object itself.
+ */
+ public MongoClusterInner withProperties(MongoClusterProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public MongoClusterInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public MongoClusterInner 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();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of MongoClusterInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of MongoClusterInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the MongoClusterInner.
+ */
+ public static MongoClusterInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ MongoClusterInner deserializedMongoClusterInner = new MongoClusterInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedMongoClusterInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedMongoClusterInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedMongoClusterInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedMongoClusterInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedMongoClusterInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedMongoClusterInner.properties = MongoClusterProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedMongoClusterInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedMongoClusterInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/OperationInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/OperationInner.java
new file mode 100644
index 0000000000000..30ff471e7dd71
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/OperationInner.java
@@ -0,0 +1,160 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.ActionType;
+import com.azure.resourcemanager.mongocluster.models.OperationDisplay;
+import com.azure.resourcemanager.mongocluster.models.Origin;
+import java.io.IOException;
+
+/**
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Immutable
+public final class OperationInner implements JsonSerializable {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure
+ * Resource Manager/control-plane operations.
+ */
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ private OperationDisplay display;
+
+ /*
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ * value is "user,system"
+ */
+ private Origin origin;
+
+ /*
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ private OperationInner() {
+ }
+
+ /**
+ * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for Azure Resource Manager/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ public Origin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are
+ * for internal only APIs.
+ *
+ * @return the actionType value.
+ */
+ public ActionType actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("display", this.display);
+ jsonWriter.writeStringField("actionType", this.actionType == null ? null : this.actionType.toString());
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationInner.
+ */
+ public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationInner deserializedOperationInner = new OperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationInner.name = reader.getString();
+ } else if ("isDataAction".equals(fieldName)) {
+ deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationInner.display = OperationDisplay.fromJson(reader);
+ } else if ("origin".equals(fieldName)) {
+ deserializedOperationInner.origin = Origin.fromString(reader.getString());
+ } else if ("actionType".equals(fieldName)) {
+ deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateEndpointConnectionResourceInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateEndpointConnectionResourceInner.java
new file mode 100644
index 0000000000000..181255cc2393d
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateEndpointConnectionResourceInner.java
@@ -0,0 +1,168 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionProperties;
+import java.io.IOException;
+
+/**
+ * Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ */
+@Fluent
+public final class PrivateEndpointConnectionResourceInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private PrivateEndpointConnectionProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /**
+ * Creates an instance of PrivateEndpointConnectionResourceInner class.
+ */
+ public PrivateEndpointConnectionResourceInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public PrivateEndpointConnectionProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the PrivateEndpointConnectionResourceInner object itself.
+ */
+ public PrivateEndpointConnectionResourceInner withProperties(PrivateEndpointConnectionProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PrivateEndpointConnectionResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PrivateEndpointConnectionResourceInner if the JsonReader was pointing to an instance of
+ * it, or null if it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the PrivateEndpointConnectionResourceInner.
+ */
+ public static PrivateEndpointConnectionResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PrivateEndpointConnectionResourceInner deserializedPrivateEndpointConnectionResourceInner
+ = new PrivateEndpointConnectionResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.properties
+ = PrivateEndpointConnectionProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedPrivateEndpointConnectionResourceInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPrivateEndpointConnectionResourceInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateLinkResourceInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateLinkResourceInner.java
new file mode 100644
index 0000000000000..e5b9c58b51c16
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/PrivateLinkResourceInner.java
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.PrivateLinkResourceProperties;
+import java.io.IOException;
+
+/**
+ * Concrete proxy resource types can be created by aliasing this type using a specific property type.
+ */
+@Immutable
+public final class PrivateLinkResourceInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private PrivateLinkResourceProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /**
+ * Creates an instance of PrivateLinkResourceInner class.
+ */
+ private PrivateLinkResourceInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public PrivateLinkResourceProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of PrivateLinkResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if
+ * it was pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the PrivateLinkResourceInner.
+ */
+ public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedPrivateLinkResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedPrivateLinkResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedPrivateLinkResourceInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedPrivateLinkResourceInner.properties = PrivateLinkResourceProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedPrivateLinkResourceInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ReplicaInner.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ReplicaInner.java
new file mode 100644
index 0000000000000..b114618035526
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/ReplicaInner.java
@@ -0,0 +1,155 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties;
+import java.io.IOException;
+
+/**
+ * Represents a mongo cluster replica.
+ */
+@Immutable
+public final class ReplicaInner extends ProxyResource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private MongoClusterProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /**
+ * Creates an instance of ReplicaInner class.
+ */
+ private ReplicaInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public MongoClusterProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ReplicaInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ReplicaInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ReplicaInner.
+ */
+ public static ReplicaInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ReplicaInner deserializedReplicaInner = new ReplicaInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedReplicaInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedReplicaInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedReplicaInner.type = reader.getString();
+ } else if ("properties".equals(fieldName)) {
+ deserializedReplicaInner.properties = MongoClusterProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedReplicaInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedReplicaInner;
+ });
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/package-info.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/package-info.java
new file mode 100644
index 0000000000000..c5de4d0cfd262
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/models/package-info.java
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the inner data models for MongoClusterManagementClient.
+ * The Microsoft Azure management API provides create, read, update, and delete functionality for Azure Cosmos DB for
+ * MongoDB vCore resources including clusters and firewall rules.
+ */
+package com.azure.resourcemanager.mongocluster.fluent.models;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/package-info.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/package-info.java
new file mode 100644
index 0000000000000..ca90018d82028
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/fluent/package-info.java
@@ -0,0 +1,10 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the service clients for MongoClusterManagementClient.
+ * The Microsoft Azure management API provides create, read, update, and delete functionality for Azure Cosmos DB for
+ * MongoDB vCore resources including clusters and firewall rules.
+ */
+package com.azure.resourcemanager.mongocluster.fluent;
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/CheckNameAvailabilityResponseImpl.java
new file mode 100644
index 0000000000000..ba97ed3f859cd
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/CheckNameAvailabilityResponseImpl.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.implementation;
+
+import com.azure.resourcemanager.mongocluster.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityReason;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityResponse;
+
+public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailabilityResponse {
+ private CheckNameAvailabilityResponseInner innerObject;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ CheckNameAvailabilityResponseImpl(CheckNameAvailabilityResponseInner innerObject,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public Boolean nameAvailable() {
+ return this.innerModel().nameAvailable();
+ }
+
+ public CheckNameAvailabilityReason reason() {
+ return this.innerModel().reason();
+ }
+
+ public String message() {
+ return this.innerModel().message();
+ }
+
+ public CheckNameAvailabilityResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java
new file mode 100644
index 0000000000000..899aa78dc1266
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientBuilder.java
@@ -0,0 +1,137 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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 DocumentDBClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { DocumentDBClientImpl.class })
+public final class DocumentDBClientBuilder {
+ /*
+ * Server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets Server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the DocumentDBClientBuilder.
+ */
+ public DocumentDBClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription. The value must be an UUID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the DocumentDBClientBuilder.
+ */
+ public DocumentDBClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the DocumentDBClientBuilder.
+ */
+ public DocumentDBClientBuilder 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 DocumentDBClientBuilder.
+ */
+ public DocumentDBClientBuilder 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 DocumentDBClientBuilder.
+ */
+ public DocumentDBClientBuilder 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 DocumentDBClientBuilder.
+ */
+ public DocumentDBClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of DocumentDBClientImpl with the provided parameters.
+ *
+ * @return an instance of DocumentDBClientImpl.
+ */
+ public DocumentDBClientImpl buildClient() {
+ 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();
+ DocumentDBClientImpl client = new DocumentDBClientImpl(localPipeline, localSerializerAdapter,
+ localDefaultPollInterval, localEnvironment, this.endpoint, this.subscriptionId);
+ return client;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java
new file mode 100644
index 0000000000000..c67154d6c70b6
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/DocumentDBClientImpl.java
@@ -0,0 +1,368 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.management.polling.PollResult;
+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.mongocluster.fluent.DocumentDBClient;
+import com.azure.resourcemanager.mongocluster.fluent.FirewallRulesClient;
+import com.azure.resourcemanager.mongocluster.fluent.MongoClustersClient;
+import com.azure.resourcemanager.mongocluster.fluent.OperationsClient;
+import com.azure.resourcemanager.mongocluster.fluent.PrivateEndpointConnectionsClient;
+import com.azure.resourcemanager.mongocluster.fluent.PrivateLinksClient;
+import com.azure.resourcemanager.mongocluster.fluent.ReplicasClient;
+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 DocumentDBClientImpl type.
+ */
+@ServiceClient(builder = DocumentDBClientBuilder.class)
+public final class DocumentDBClientImpl implements DocumentDBClient {
+ /**
+ * Server parameter.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets Server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Version parameter.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * The HTTP pipeline to send requests through.
+ */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /**
+ * The serializer to serialize an object into a string.
+ */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /**
+ * The default poll interval for long-running operation.
+ */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /**
+ * The OperationsClient object to access its operations.
+ */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /**
+ * The MongoClustersClient object to access its operations.
+ */
+ private final MongoClustersClient mongoClusters;
+
+ /**
+ * Gets the MongoClustersClient object to access its operations.
+ *
+ * @return the MongoClustersClient object.
+ */
+ public MongoClustersClient getMongoClusters() {
+ return this.mongoClusters;
+ }
+
+ /**
+ * The FirewallRulesClient object to access its operations.
+ */
+ private final FirewallRulesClient firewallRules;
+
+ /**
+ * Gets the FirewallRulesClient object to access its operations.
+ *
+ * @return the FirewallRulesClient object.
+ */
+ public FirewallRulesClient getFirewallRules() {
+ return this.firewallRules;
+ }
+
+ /**
+ * The PrivateEndpointConnectionsClient object to access its operations.
+ */
+ private final PrivateEndpointConnectionsClient privateEndpointConnections;
+
+ /**
+ * Gets the PrivateEndpointConnectionsClient object to access its operations.
+ *
+ * @return the PrivateEndpointConnectionsClient object.
+ */
+ public PrivateEndpointConnectionsClient getPrivateEndpointConnections() {
+ return this.privateEndpointConnections;
+ }
+
+ /**
+ * The PrivateLinksClient object to access its operations.
+ */
+ private final PrivateLinksClient privateLinks;
+
+ /**
+ * Gets the PrivateLinksClient object to access its operations.
+ *
+ * @return the PrivateLinksClient object.
+ */
+ public PrivateLinksClient getPrivateLinks() {
+ return this.privateLinks;
+ }
+
+ /**
+ * The ReplicasClient object to access its operations.
+ */
+ private final ReplicasClient replicas;
+
+ /**
+ * Gets the ReplicasClient object to access its operations.
+ *
+ * @return the ReplicasClient object.
+ */
+ public ReplicasClient getReplicas() {
+ return this.replicas;
+ }
+
+ /**
+ * Initializes an instance of DocumentDBClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param endpoint Server parameter.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ */
+ DocumentDBClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval,
+ AzureEnvironment environment, String endpoint, String subscriptionId) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.endpoint = endpoint;
+ this.subscriptionId = subscriptionId;
+ this.apiVersion = "2024-06-01-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.mongoClusters = new MongoClustersClientImpl(this);
+ this.firewallRules = new FirewallRulesClientImpl(this);
+ this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this);
+ this.privateLinks = new PrivateLinksClientImpl(this);
+ this.replicas = new ReplicasClientImpl(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(HttpHeaderName.fromString(s));
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DocumentDBClientImpl.class);
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRuleImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRuleImpl.java
new file mode 100644
index 0000000000000..3b33a5bc74650
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRuleImpl.java
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.mongocluster.fluent.models.FirewallRuleInner;
+import com.azure.resourcemanager.mongocluster.models.FirewallRule;
+import com.azure.resourcemanager.mongocluster.models.FirewallRuleProperties;
+
+public final class FirewallRuleImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update {
+ private FirewallRuleInner innerObject;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public FirewallRuleProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public FirewallRuleInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String mongoClusterName;
+
+ private String firewallRuleName;
+
+ public FirewallRuleImpl withExistingMongoCluster(String resourceGroupName, String mongoClusterName) {
+ this.resourceGroupName = resourceGroupName;
+ this.mongoClusterName = mongoClusterName;
+ return this;
+ }
+
+ public FirewallRule create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, mongoClusterName, firewallRuleName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public FirewallRule create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, mongoClusterName, firewallRuleName, this.innerModel(), context);
+ return this;
+ }
+
+ FirewallRuleImpl(String name, com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = new FirewallRuleInner();
+ this.serviceManager = serviceManager;
+ this.firewallRuleName = name;
+ }
+
+ public FirewallRuleImpl update() {
+ return this;
+ }
+
+ public FirewallRule apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, mongoClusterName, firewallRuleName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public FirewallRule apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getFirewallRules()
+ .createOrUpdate(resourceGroupName, mongoClusterName, firewallRuleName, this.innerModel(), context);
+ return this;
+ }
+
+ FirewallRuleImpl(FirewallRuleInner innerObject,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.mongoClusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "mongoClusters");
+ this.firewallRuleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "firewallRules");
+ }
+
+ public FirewallRule refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getFirewallRules()
+ .getWithResponse(resourceGroupName, mongoClusterName, firewallRuleName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public FirewallRule refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getFirewallRules()
+ .getWithResponse(resourceGroupName, mongoClusterName, firewallRuleName, context)
+ .getValue();
+ return this;
+ }
+
+ public FirewallRuleImpl withProperties(FirewallRuleProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java
new file mode 100644
index 0000000000000..c15f8654b8137
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesClientImpl.java
@@ -0,0 +1,941 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.PathParam;
+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.mongocluster.fluent.FirewallRulesClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.FirewallRuleInner;
+import com.azure.resourcemanager.mongocluster.implementation.models.FirewallRuleListResult;
+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 FirewallRulesClient.
+ */
+public final class FirewallRulesClientImpl implements FirewallRulesClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final FirewallRulesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DocumentDBClientImpl client;
+
+ /**
+ * Initializes an instance of FirewallRulesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ FirewallRulesClientImpl(DocumentDBClientImpl client) {
+ this.service
+ = RestProxy.create(FirewallRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DocumentDBClientFirewallRules to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DocumentDBClientFire")
+ public interface FirewallRulesService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({ 200, 201, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("accept") String accept,
+ @BodyParam("application/json") FirewallRuleInner resource, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("firewallRuleName") String firewallRuleName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByMongoCluster(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByMongoClusterNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("accept") String accept, Context context);
+ }
+
+ /**
+ * Gets information about a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 information about a mongo cluster firewall rule along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets information about a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 information about a mongo cluster firewall rule along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, firewallRuleName, accept, context);
+ }
+
+ /**
+ * Gets information about a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 information about a mongo cluster firewall rule on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName) {
+ return getWithResponseAsync(resourceGroupName, mongoClusterName, firewallRuleName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets information about a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 information about a mongo cluster firewall rule along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName, Context context) {
+ return getWithResponseAsync(resourceGroupName, mongoClusterName, firewallRuleName, context).block();
+ }
+
+ /**
+ * Gets information about a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 information about a mongo cluster firewall rule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FirewallRuleInner get(String resourceGroupName, String mongoClusterName, String firewallRuleName) {
+ return getWithResponse(resourceGroupName, mongoClusterName, firewallRuleName, Context.NONE).getValue();
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String mongoClusterName, String firewallRuleName, FirewallRuleInner resource) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept,
+ resource, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String mongoClusterName, String firewallRuleName, FirewallRuleInner resource, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept, resource,
+ context);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @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, FirewallRuleInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String mongoClusterName, String firewallRuleName, FirewallRuleInner resource) {
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ FirewallRuleInner.class, FirewallRuleInner.class, this.client.getContext());
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @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, FirewallRuleInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String mongoClusterName, String firewallRuleName, FirewallRuleInner resource,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ FirewallRuleInner.class, FirewallRuleInner.class, context);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @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, FirewallRuleInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, String firewallRuleName, FirewallRuleInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @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, FirewallRuleInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, String firewallRuleName, FirewallRuleInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName, FirewallRuleInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName, FirewallRuleInner resource, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FirewallRuleInner createOrUpdate(String resourceGroupName, String mongoClusterName, String firewallRuleName,
+ FirewallRuleInner resource) {
+ return createOrUpdateAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource).block();
+ }
+
+ /**
+ * Creates a new firewall rule or updates an existing firewall rule on a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @param resource Resource create parameters.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public FirewallRuleInner createOrUpdate(String resourceGroupName, String mongoClusterName, String firewallRuleName,
+ FirewallRuleInner resource, Context context) {
+ return createOrUpdateAsync(resourceGroupName, mongoClusterName, firewallRuleName, resource, context).block();
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, firewallRuleName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (firewallRuleName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, firewallRuleName, accept, context);
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName) {
+ Mono>> mono
+ = deleteWithResponseAsync(resourceGroupName, mongoClusterName, firewallRuleName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = deleteWithResponseAsync(resourceGroupName, mongoClusterName, firewallRuleName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName) {
+ return this.beginDeleteAsync(resourceGroupName, mongoClusterName, firewallRuleName).getSyncPoller();
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName,
+ String firewallRuleName, Context context) {
+ return this.beginDeleteAsync(resourceGroupName, mongoClusterName, firewallRuleName, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName, String firewallRuleName) {
+ return beginDeleteAsync(resourceGroupName, mongoClusterName, firewallRuleName).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName, String firewallRuleName,
+ Context context) {
+ return beginDeleteAsync(resourceGroupName, mongoClusterName, firewallRuleName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName, String firewallRuleName) {
+ deleteAsync(resourceGroupName, mongoClusterName, firewallRuleName).block();
+ }
+
+ /**
+ * Deletes a mongo cluster firewall rule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param firewallRuleName The name of the mongo cluster firewall rule.
+ * @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 mongoClusterName, String firewallRuleName, Context context) {
+ deleteAsync(resourceGroupName, mongoClusterName, firewallRuleName, context).block();
+ }
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByMongoClusterSinglePageAsync(String resourceGroupName,
+ String mongoClusterName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByMongoCluster(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByMongoClusterSinglePageAsync(String resourceGroupName,
+ String mongoClusterName, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByMongoCluster(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByMongoClusterAsync(String resourceGroupName, String mongoClusterName) {
+ return new PagedFlux<>(() -> listByMongoClusterSinglePageAsync(resourceGroupName, mongoClusterName),
+ nextLink -> listByMongoClusterNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByMongoClusterAsync(String resourceGroupName, String mongoClusterName,
+ Context context) {
+ return new PagedFlux<>(() -> listByMongoClusterSinglePageAsync(resourceGroupName, mongoClusterName, context),
+ nextLink -> listByMongoClusterNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName) {
+ return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName));
+ }
+
+ /**
+ * List all the firewall rules in a given mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
+ Context context) {
+ return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByMongoClusterNextSinglePageAsync(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.listByMongoClusterNext(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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a FirewallRule list operation along with {@link PagedResponse} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByMongoClusterNextSinglePageAsync(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.listByMongoClusterNext(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/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesImpl.java
new file mode 100644
index 0000000000000..6b408ab3abcab
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/FirewallRulesImpl.java
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.FirewallRulesClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.FirewallRuleInner;
+import com.azure.resourcemanager.mongocluster.models.FirewallRule;
+import com.azure.resourcemanager.mongocluster.models.FirewallRules;
+
+public final class FirewallRulesImpl implements FirewallRules {
+ private static final ClientLogger LOGGER = new ClientLogger(FirewallRulesImpl.class);
+
+ private final FirewallRulesClient innerClient;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ public FirewallRulesImpl(FirewallRulesClient innerClient,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(String resourceGroupName, String mongoClusterName,
+ String firewallRuleName, Context context) {
+ Response inner
+ = this.serviceClient().getWithResponse(resourceGroupName, mongoClusterName, firewallRuleName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new FirewallRuleImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public FirewallRule get(String resourceGroupName, String mongoClusterName, String firewallRuleName) {
+ FirewallRuleInner inner = this.serviceClient().get(resourceGroupName, mongoClusterName, firewallRuleName);
+ if (inner != null) {
+ return new FirewallRuleImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String resourceGroupName, String mongoClusterName, String firewallRuleName) {
+ this.serviceClient().delete(resourceGroupName, mongoClusterName, firewallRuleName);
+ }
+
+ public void delete(String resourceGroupName, String mongoClusterName, String firewallRuleName, Context context) {
+ this.serviceClient().delete(resourceGroupName, mongoClusterName, firewallRuleName, context);
+ }
+
+ public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName) {
+ PagedIterable inner
+ = this.serviceClient().listByMongoCluster(resourceGroupName, mongoClusterName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByMongoCluster(String resourceGroupName, String mongoClusterName,
+ Context context) {
+ PagedIterable inner
+ = this.serviceClient().listByMongoCluster(resourceGroupName, mongoClusterName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
+ }
+
+ public FirewallRule getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules");
+ if (firewallRuleName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, mongoClusterName, firewallRuleName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules");
+ if (firewallRuleName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, mongoClusterName, firewallRuleName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules");
+ if (firewallRuleName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id)));
+ }
+ this.delete(resourceGroupName, mongoClusterName, firewallRuleName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ String firewallRuleName = ResourceManagerUtils.getValueFromIdByName(id, "firewallRules");
+ if (firewallRuleName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'firewallRules'.", id)));
+ }
+ this.delete(resourceGroupName, mongoClusterName, firewallRuleName, context);
+ }
+
+ private FirewallRulesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+
+ public FirewallRuleImpl define(String name) {
+ return new FirewallRuleImpl(name, this.manager());
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ListConnectionStringsResultImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ListConnectionStringsResultImpl.java
new file mode 100644
index 0000000000000..25f607d90a2c0
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/ListConnectionStringsResultImpl.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.implementation;
+
+import com.azure.resourcemanager.mongocluster.fluent.models.ListConnectionStringsResultInner;
+import com.azure.resourcemanager.mongocluster.models.ConnectionString;
+import com.azure.resourcemanager.mongocluster.models.ListConnectionStringsResult;
+import java.util.Collections;
+import java.util.List;
+
+public final class ListConnectionStringsResultImpl implements ListConnectionStringsResult {
+ private ListConnectionStringsResultInner innerObject;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ ListConnectionStringsResultImpl(ListConnectionStringsResultInner innerObject,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public List connectionStrings() {
+ List inner = this.innerModel().connectionStrings();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ListConnectionStringsResultInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterImpl.java
new file mode 100644
index 0000000000000..0f774e7d4c2b5
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClusterImpl.java
@@ -0,0 +1,203 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.mongocluster.fluent.models.MongoClusterInner;
+import com.azure.resourcemanager.mongocluster.models.ListConnectionStringsResult;
+import com.azure.resourcemanager.mongocluster.models.MongoCluster;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterProperties;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdateProperties;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
+import java.util.Collections;
+import java.util.Map;
+
+public final class MongoClusterImpl implements MongoCluster, MongoCluster.Definition, MongoCluster.Update {
+ private MongoClusterInner innerObject;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager 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 MongoClusterProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public MongoClusterInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String mongoClusterName;
+
+ private MongoClusterUpdate updateProperties;
+
+ public MongoClusterImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public MongoCluster create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getMongoClusters()
+ .createOrUpdate(resourceGroupName, mongoClusterName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public MongoCluster create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getMongoClusters()
+ .createOrUpdate(resourceGroupName, mongoClusterName, this.innerModel(), context);
+ return this;
+ }
+
+ MongoClusterImpl(String name, com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = new MongoClusterInner();
+ this.serviceManager = serviceManager;
+ this.mongoClusterName = name;
+ }
+
+ public MongoClusterImpl update() {
+ this.updateProperties = new MongoClusterUpdate();
+ return this;
+ }
+
+ public MongoCluster apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getMongoClusters()
+ .update(resourceGroupName, mongoClusterName, updateProperties, Context.NONE);
+ return this;
+ }
+
+ public MongoCluster apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getMongoClusters()
+ .update(resourceGroupName, mongoClusterName, updateProperties, context);
+ return this;
+ }
+
+ MongoClusterImpl(MongoClusterInner innerObject,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.mongoClusterName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "mongoClusters");
+ }
+
+ public MongoCluster refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getMongoClusters()
+ .getByResourceGroupWithResponse(resourceGroupName, mongoClusterName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public MongoCluster refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getMongoClusters()
+ .getByResourceGroupWithResponse(resourceGroupName, mongoClusterName, context)
+ .getValue();
+ return this;
+ }
+
+ public Response listConnectionStringsWithResponse(Context context) {
+ return serviceManager.mongoClusters()
+ .listConnectionStringsWithResponse(resourceGroupName, mongoClusterName, context);
+ }
+
+ public ListConnectionStringsResult listConnectionStrings() {
+ return serviceManager.mongoClusters().listConnectionStrings(resourceGroupName, mongoClusterName);
+ }
+
+ public void promote(PromoteReplicaRequest body) {
+ serviceManager.mongoClusters().promote(resourceGroupName, mongoClusterName, body);
+ }
+
+ public void promote(PromoteReplicaRequest body, Context context) {
+ serviceManager.mongoClusters().promote(resourceGroupName, mongoClusterName, body, context);
+ }
+
+ public MongoClusterImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public MongoClusterImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public MongoClusterImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateProperties.withTags(tags);
+ return this;
+ }
+ }
+
+ public MongoClusterImpl withProperties(MongoClusterProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+
+ public MongoClusterImpl withProperties(MongoClusterUpdateProperties properties) {
+ this.updateProperties.withProperties(properties);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java
new file mode 100644
index 0000000000000..564962a5a0c16
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersClientImpl.java
@@ -0,0 +1,1813 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.MongoClustersClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.mongocluster.fluent.models.ListConnectionStringsResultInner;
+import com.azure.resourcemanager.mongocluster.fluent.models.MongoClusterInner;
+import com.azure.resourcemanager.mongocluster.implementation.models.MongoClusterListResult;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.mongocluster.models.MongoClusterUpdate;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
+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 MongoClustersClient.
+ */
+public final class MongoClustersClientImpl implements MongoClustersClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final MongoClustersService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DocumentDBClientImpl client;
+
+ /**
+ * Initializes an instance of MongoClustersClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ MongoClustersClientImpl(DocumentDBClientImpl client) {
+ this.service
+ = RestProxy.create(MongoClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DocumentDBClientMongoClusters to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DocumentDBClientMong")
+ public interface MongoClustersService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ @BodyParam("application/json") MongoClusterInner resource, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ @BodyParam("application/json") MongoClusterUpdate properties, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/mongoClusters")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listConnectionStrings(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> checkNameAvailability(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("location") String location, @HeaderParam("accept") String accept,
+ @BodyParam("application/json") CheckNameAvailabilityRequest body, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/promote")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> promote(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ @BodyParam("application/json") PromoteReplicaRequest body, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context);
+ }
+
+ /**
+ * Gets information about a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 information about a mongo cluster along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String mongoClusterName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets information about a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 information about a mongo cluster along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String mongoClusterName, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context);
+ }
+
+ /**
+ * Gets information about a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 information about a mongo cluster on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String mongoClusterName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, mongoClusterName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets information about a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 information about a mongo cluster along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String mongoClusterName,
+ Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, mongoClusterName, context).block();
+ }
+
+ /**
+ * Gets information about a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 information about a mongo cluster.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MongoClusterInner getByResourceGroup(String resourceGroupName, String mongoClusterName) {
+ return getByResourceGroupWithResponse(resourceGroupName, mongoClusterName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String mongoClusterName, MongoClusterInner resource) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, resource, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String mongoClusterName, MongoClusterInner resource, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, resource, context);
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MongoClusterInner>
+ beginCreateOrUpdateAsync(String resourceGroupName, String mongoClusterName, MongoClusterInner resource) {
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, mongoClusterName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ MongoClusterInner.class, MongoClusterInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MongoClusterInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String mongoClusterName, MongoClusterInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, mongoClusterName, resource, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ MongoClusterInner.class, MongoClusterInner.class, context);
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MongoClusterInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MongoClusterInner> beginCreateOrUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, resource, context).getSyncPoller();
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String mongoClusterName,
+ MongoClusterInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String mongoClusterName,
+ MongoClusterInner resource, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, mongoClusterName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MongoClusterInner createOrUpdate(String resourceGroupName, String mongoClusterName,
+ MongoClusterInner resource) {
+ return createOrUpdateAsync(resourceGroupName, mongoClusterName, resource).block();
+ }
+
+ /**
+ * Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the
+ * properties, use PATCH.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param resource Resource create parameters.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MongoClusterInner createOrUpdate(String resourceGroupName, String mongoClusterName,
+ MongoClusterInner resource, Context context) {
+ return createOrUpdateAsync(resourceGroupName, mongoClusterName, resource, context).block();
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ MongoClusterUpdate properties) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, properties, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ MongoClusterUpdate properties, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, accept, properties, context);
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MongoClusterInner> beginUpdateAsync(String resourceGroupName,
+ String mongoClusterName, MongoClusterUpdate properties) {
+ Mono>> mono
+ = updateWithResponseAsync(resourceGroupName, mongoClusterName, properties);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ MongoClusterInner.class, MongoClusterInner.class, this.client.getContext());
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, MongoClusterInner> beginUpdateAsync(String resourceGroupName,
+ String mongoClusterName, MongoClusterUpdate properties, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = updateWithResponseAsync(resourceGroupName, mongoClusterName, properties, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ MongoClusterInner.class, MongoClusterInner.class, context);
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MongoClusterInner> beginUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterUpdate properties) {
+ return this.beginUpdateAsync(resourceGroupName, mongoClusterName, properties).getSyncPoller();
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, MongoClusterInner> beginUpdate(String resourceGroupName,
+ String mongoClusterName, MongoClusterUpdate properties, Context context) {
+ return this.beginUpdateAsync(resourceGroupName, mongoClusterName, properties, context).getSyncPoller();
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String mongoClusterName,
+ MongoClusterUpdate properties) {
+ return beginUpdateAsync(resourceGroupName, mongoClusterName, properties).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String mongoClusterName,
+ MongoClusterUpdate properties, Context context) {
+ return beginUpdateAsync(resourceGroupName, mongoClusterName, properties, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MongoClusterInner update(String resourceGroupName, String mongoClusterName, MongoClusterUpdate properties) {
+ return updateAsync(resourceGroupName, mongoClusterName, properties).block();
+ }
+
+ /**
+ * Updates an existing mongo cluster. The request body can contain one to many of the properties present in the
+ * normal mongo cluster definition.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param properties The resource properties to be updated.
+ * @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 represents a mongo cluster resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MongoClusterInner update(String resourceGroupName, String mongoClusterName, MongoClusterUpdate properties,
+ Context context) {
+ return updateAsync(resourceGroupName, mongoClusterName, properties, context).block();
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName,
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, accept, context);
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, mongoClusterName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, mongoClusterName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName) {
+ return this.beginDeleteAsync(resourceGroupName, mongoClusterName).getSyncPoller();
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName,
+ Context context) {
+ return this.beginDeleteAsync(resourceGroupName, mongoClusterName, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName) {
+ return beginDeleteAsync(resourceGroupName, mongoClusterName).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName, Context context) {
+ return beginDeleteAsync(resourceGroupName, mongoClusterName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName) {
+ deleteAsync(resourceGroupName, mongoClusterName).block();
+ }
+
+ /**
+ * Deletes a mongo cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 mongoClusterName, Context context) {
+ deleteAsync(resourceGroupName, mongoClusterName, context).block();
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation 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.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation 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.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation 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));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation 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.getApiVersion(),
+ this.client.getSubscriptionId(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation 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.getApiVersion(), this.client.getSubscriptionId(), accept,
+ context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List all the mongo clusters in a given 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 the response of a MongoCluster list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well
+ * as other connection strings supported by the cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 connection strings for the given mongo cluster along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listConnectionStringsWithResponseAsync(String resourceGroupName, String mongoClusterName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listConnectionStrings(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well
+ * as other connection strings supported by the cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 connection strings for the given mongo cluster along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listConnectionStringsWithResponseAsync(String resourceGroupName, String mongoClusterName, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listConnectionStrings(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context);
+ }
+
+ /**
+ * List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well
+ * as other connection strings supported by the cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 connection strings for the given mongo cluster on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono listConnectionStringsAsync(String resourceGroupName,
+ String mongoClusterName) {
+ return listConnectionStringsWithResponseAsync(resourceGroupName, mongoClusterName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well
+ * as other connection strings supported by the cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 connection strings for the given mongo cluster along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response listConnectionStringsWithResponse(String resourceGroupName,
+ String mongoClusterName, Context context) {
+ return listConnectionStringsWithResponseAsync(resourceGroupName, mongoClusterName, context).block();
+ }
+
+ /**
+ * List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well
+ * as other connection strings supported by the cluster.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @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 connection strings for the given mongo cluster.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ListConnectionStringsResultInner listConnectionStrings(String resourceGroupName, String mongoClusterName) {
+ return listConnectionStringsWithResponse(resourceGroupName, mongoClusterName, Context.NONE).getValue();
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The location name.
+ * @param body The CheckAvailability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> checkNameAvailabilityWithResponseAsync(String location,
+ CheckNameAvailabilityRequest 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 (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location 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.checkNameAvailability(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, body, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The location name.
+ * @param body The CheckAvailability request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> checkNameAvailabilityWithResponseAsync(String location,
+ CheckNameAvailabilityRequest 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 (location == null) {
+ return Mono.error(new IllegalArgumentException("Parameter location 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.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), location, accept, body, context);
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The location name.
+ * @param body The CheckAvailability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono checkNameAvailabilityAsync(String location,
+ CheckNameAvailabilityRequest body) {
+ return checkNameAvailabilityWithResponseAsync(location, body).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The location name.
+ * @param body The CheckAvailability request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response checkNameAvailabilityWithResponse(String location,
+ CheckNameAvailabilityRequest body, Context context) {
+ return checkNameAvailabilityWithResponseAsync(location, body, context).block();
+ }
+
+ /**
+ * Check if mongo cluster name is available for use.
+ *
+ * @param location The location name.
+ * @param body The CheckAvailability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the check availability result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CheckNameAvailabilityResponseInner checkNameAvailability(String location,
+ CheckNameAvailabilityRequest body) {
+ return checkNameAvailabilityWithResponse(location, body, Context.NONE).getValue();
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> promoteWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName 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.promote(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, body, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> promoteWithResponseAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName 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.promote(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, accept, body, context);
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginPromoteAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body) {
+ Mono>> mono = promoteWithResponseAsync(resourceGroupName, mongoClusterName, body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginPromoteAsync(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = promoteWithResponseAsync(resourceGroupName, mongoClusterName, body, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body) {
+ return this.beginPromoteAsync(resourceGroupName, mongoClusterName, body).getSyncPoller();
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginPromote(String resourceGroupName, String mongoClusterName,
+ PromoteReplicaRequest body, Context context) {
+ return this.beginPromoteAsync(resourceGroupName, mongoClusterName, body, context).getSyncPoller();
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono promoteAsync(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body) {
+ return beginPromoteAsync(resourceGroupName, mongoClusterName, body).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono promoteAsync(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body,
+ Context context) {
+ return beginPromoteAsync(resourceGroupName, mongoClusterName, body, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body) {
+ promoteAsync(resourceGroupName, mongoClusterName, body).block();
+ }
+
+ /**
+ * Promotes a replica mongo cluster to a primary role.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param body The content of the action request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body,
+ Context context) {
+ promoteAsync(resourceGroupName, mongoClusterName, body, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a MongoCluster list operation 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a MongoCluster list operation 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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a MongoCluster list operation 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a MongoCluster list operation 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/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersImpl.java
new file mode 100644
index 0000000000000..5085f71661114
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/MongoClustersImpl.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.MongoClustersClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.CheckNameAvailabilityResponseInner;
+import com.azure.resourcemanager.mongocluster.fluent.models.ListConnectionStringsResultInner;
+import com.azure.resourcemanager.mongocluster.fluent.models.MongoClusterInner;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.mongocluster.models.CheckNameAvailabilityResponse;
+import com.azure.resourcemanager.mongocluster.models.ListConnectionStringsResult;
+import com.azure.resourcemanager.mongocluster.models.MongoCluster;
+import com.azure.resourcemanager.mongocluster.models.MongoClusters;
+import com.azure.resourcemanager.mongocluster.models.PromoteReplicaRequest;
+
+public final class MongoClustersImpl implements MongoClusters {
+ private static final ClientLogger LOGGER = new ClientLogger(MongoClustersImpl.class);
+
+ private final MongoClustersClient innerClient;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ public MongoClustersImpl(MongoClustersClient innerClient,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String mongoClusterName,
+ Context context) {
+ Response inner
+ = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, mongoClusterName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new MongoClusterImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public MongoCluster getByResourceGroup(String resourceGroupName, String mongoClusterName) {
+ MongoClusterInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, mongoClusterName);
+ if (inner != null) {
+ return new MongoClusterImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String mongoClusterName) {
+ this.serviceClient().delete(resourceGroupName, mongoClusterName);
+ }
+
+ public void delete(String resourceGroupName, String mongoClusterName, Context context) {
+ this.serviceClient().delete(resourceGroupName, mongoClusterName, context);
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new MongoClusterImpl(inner1, this.manager()));
+ }
+
+ public Response listConnectionStringsWithResponse(String resourceGroupName,
+ String mongoClusterName, Context context) {
+ Response inner
+ = this.serviceClient().listConnectionStringsWithResponse(resourceGroupName, mongoClusterName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new ListConnectionStringsResultImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ListConnectionStringsResult listConnectionStrings(String resourceGroupName, String mongoClusterName) {
+ ListConnectionStringsResultInner inner
+ = this.serviceClient().listConnectionStrings(resourceGroupName, mongoClusterName);
+ if (inner != null) {
+ return new ListConnectionStringsResultImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response checkNameAvailabilityWithResponse(String location,
+ CheckNameAvailabilityRequest body, Context context) {
+ Response inner
+ = this.serviceClient().checkNameAvailabilityWithResponse(location, body, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public CheckNameAvailabilityResponse checkNameAvailability(String location, CheckNameAvailabilityRequest body) {
+ CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(location, body);
+ if (inner != null) {
+ return new CheckNameAvailabilityResponseImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body) {
+ this.serviceClient().promote(resourceGroupName, mongoClusterName, body);
+ }
+
+ public void promote(String resourceGroupName, String mongoClusterName, PromoteReplicaRequest body,
+ Context context) {
+ this.serviceClient().promote(resourceGroupName, mongoClusterName, body, context);
+ }
+
+ public MongoCluster getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, mongoClusterName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, mongoClusterName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ this.delete(resourceGroupName, mongoClusterName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.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 mongoClusterName = ResourceManagerUtils.getValueFromIdByName(id, "mongoClusters");
+ if (mongoClusterName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'mongoClusters'.", id)));
+ }
+ this.delete(resourceGroupName, mongoClusterName, context);
+ }
+
+ private MongoClustersClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+
+ public MongoClusterImpl define(String name) {
+ return new MongoClusterImpl(name, this.manager());
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationImpl.java
new file mode 100644
index 0000000000000..cd003b9ad1baa
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.implementation;
+
+import com.azure.resourcemanager.mongocluster.fluent.models.OperationInner;
+import com.azure.resourcemanager.mongocluster.models.ActionType;
+import com.azure.resourcemanager.mongocluster.models.Operation;
+import com.azure.resourcemanager.mongocluster.models.OperationDisplay;
+import com.azure.resourcemanager.mongocluster.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ OperationImpl(OperationInner innerObject,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public Origin origin() {
+ return this.innerModel().origin();
+ }
+
+ public ActionType actionType() {
+ return this.innerModel().actionType();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java
new file mode 100644
index 0000000000000..ddcad08ab734f
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsClientImpl.java
@@ -0,0 +1,235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.OperationsClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.OperationInner;
+import com.azure.resourcemanager.mongocluster.implementation.models.OperationListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public final class OperationsClientImpl implements OperationsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final OperationsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DocumentDBClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(DocumentDBClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DocumentDBClientOperations to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DocumentDBClientOper")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.DocumentDB/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("accept") String accept, Context context);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ 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.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ 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.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} 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/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsImpl.java
new file mode 100644
index 0000000000000..341c50b16fc54
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.mongocluster.fluent.OperationsClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.OperationInner;
+import com.azure.resourcemanager.mongocluster.models.Operation;
+import com.azure.resourcemanager.mongocluster.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.mongocluster.MongoClusterManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionResourceImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionResourceImpl.java
new file mode 100644
index 0000000000000..2c6c557d6f733
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionResourceImpl.java
@@ -0,0 +1,108 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.mongocluster.fluent.models.PrivateEndpointConnectionResourceInner;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionProperties;
+import com.azure.resourcemanager.mongocluster.models.PrivateEndpointConnectionResource;
+
+public final class PrivateEndpointConnectionResourceImpl
+ implements PrivateEndpointConnectionResource, PrivateEndpointConnectionResource.Definition {
+ private PrivateEndpointConnectionResourceInner innerObject;
+
+ private final com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager;
+
+ PrivateEndpointConnectionResourceImpl(PrivateEndpointConnectionResourceInner innerObject,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public PrivateEndpointConnectionProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public PrivateEndpointConnectionResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.mongocluster.MongoClusterManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String mongoClusterName;
+
+ private String privateEndpointConnectionName;
+
+ public PrivateEndpointConnectionResourceImpl withExistingMongoCluster(String resourceGroupName,
+ String mongoClusterName) {
+ this.resourceGroupName = resourceGroupName;
+ this.mongoClusterName = mongoClusterName;
+ return this;
+ }
+
+ public PrivateEndpointConnectionResource create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getPrivateEndpointConnections()
+ .create(resourceGroupName, mongoClusterName, privateEndpointConnectionName, this.innerModel(),
+ Context.NONE);
+ return this;
+ }
+
+ public PrivateEndpointConnectionResource create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getPrivateEndpointConnections()
+ .create(resourceGroupName, mongoClusterName, privateEndpointConnectionName, this.innerModel(), context);
+ return this;
+ }
+
+ PrivateEndpointConnectionResourceImpl(String name,
+ com.azure.resourcemanager.mongocluster.MongoClusterManager serviceManager) {
+ this.innerObject = new PrivateEndpointConnectionResourceInner();
+ this.serviceManager = serviceManager;
+ this.privateEndpointConnectionName = name;
+ }
+
+ public PrivateEndpointConnectionResource refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse(resourceGroupName, mongoClusterName, privateEndpointConnectionName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public PrivateEndpointConnectionResource refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getPrivateEndpointConnections()
+ .getWithResponse(resourceGroupName, mongoClusterName, privateEndpointConnectionName, context)
+ .getValue();
+ return this;
+ }
+
+ public PrivateEndpointConnectionResourceImpl withProperties(PrivateEndpointConnectionProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java
new file mode 100644
index 0000000000000..277e962a7b368
--- /dev/null
+++ b/sdk/mongocluster/azure-resourcemanager-mongocluster/src/main/java/com/azure/resourcemanager/mongocluster/implementation/PrivateEndpointConnectionsClientImpl.java
@@ -0,0 +1,991 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.mongocluster.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.PathParam;
+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.mongocluster.fluent.PrivateEndpointConnectionsClient;
+import com.azure.resourcemanager.mongocluster.fluent.models.PrivateEndpointConnectionResourceInner;
+import com.azure.resourcemanager.mongocluster.implementation.models.PrivateEndpointConnectionResourceListResult;
+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 PrivateEndpointConnectionsClient.
+ */
+public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpointConnectionsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final PrivateEndpointConnectionsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final DocumentDBClientImpl client;
+
+ /**
+ * Initializes an instance of PrivateEndpointConnectionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ PrivateEndpointConnectionsClientImpl(DocumentDBClientImpl client) {
+ this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DocumentDBClientPrivateEndpointConnections to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "DocumentDBClientPriv")
+ public interface PrivateEndpointConnectionsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByMongoCluster(
+ @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName, @HeaderParam("accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
+ @HeaderParam("accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}")
+ @ExpectedResponses({ 200, 201, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> create(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
+ @HeaderParam("accept") String accept,
+ @BodyParam("application/json") PrivateEndpointConnectionResourceInner resource, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/privateEndpointConnections/{privateEndpointConnectionName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("mongoClusterName") String mongoClusterName,
+ @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName,
+ @HeaderParam("accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByMongoClusterNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("accept") String accept, Context context);
+ }
+
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listByMongoClusterSinglePageAsync(String resourceGroupName, String mongoClusterName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByMongoCluster(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(),
+ res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listByMongoClusterSinglePageAsync(String resourceGroupName, String mongoClusterName, 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByMongoCluster(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, mongoClusterName, accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByMongoClusterAsync(String resourceGroupName,
+ String mongoClusterName) {
+ return new PagedFlux<>(() -> listByMongoClusterSinglePageAsync(resourceGroupName, mongoClusterName),
+ nextLink -> listByMongoClusterNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByMongoClusterAsync(String resourceGroupName,
+ String mongoClusterName, Context context) {
+ return new PagedFlux<>(() -> listByMongoClusterSinglePageAsync(resourceGroupName, mongoClusterName, context),
+ nextLink -> listByMongoClusterNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByMongoCluster(String resourceGroupName,
+ String mongoClusterName) {
+ return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName));
+ }
+
+ /**
+ * List existing private connections.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a PrivateEndpointConnectionResource list operation as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByMongoCluster(String resourceGroupName,
+ String mongoClusterName, Context context) {
+ return new PagedIterable<>(listByMongoClusterAsync(resourceGroupName, mongoClusterName, context));
+ }
+
+ /**
+ * Get a specific private connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 specific private connection along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String resourceGroupName,
+ String mongoClusterName, String privateEndpointConnectionName) {
+ 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 (mongoClusterName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter mongoClusterName is required and cannot be null."));
+ }
+ if (privateEndpointConnectionName == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter privateEndpointConnectionName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, mongoClusterName, privateEndpointConnectionName,
+ accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a specific private connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param mongoClusterName The name of the mongo cluster.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @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 specific private connection along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono